How to store a file on a server(web container) through a Java EE web application?

后端 未结 2 1146
醉酒成梦
醉酒成梦 2020-12-01 05:41

I have developed a Java EE web application. This application allows a user to upload a file with the help of a browser. Once the user has uploaded his file, this application

2条回答
  •  一个人的身影
    2020-12-01 06:29

    Writing to the file system from a Java EE container is not really recommended, especially if you need to process the written data:

    • it is not transactional
    • it harms the portability (what if you are in a clustered environment)
    • it requires to setup external parameters for the target location

    If this is an option, I would store the files in database or use a JCR repository (like Jackrabbit).

提交回复
热议问题