As the title says, what is the prefered way of saving an uploaded file in a Java EE web application? I read some answers on other questions that saving the file to the filesystem of the servlet container is not recommended without further explanation. Some say you should save it to a database (but I doubt that from what I have read earlier) and some say that you should use JCR where the only implementation I can find is Apache JackRabbit, which doesn't seem to be very active?
What would be the best option? Are there other than those mentioned? Reasons why you would choose one over the other is appriciated.