What do you suggest for location of images that the user uploads 开发者_JS百科to my application?
in my server application (like WebContent->images) or in system location?
Store it outside the Tomcat installation. That makes updates of both Tomcat and your application a lot easier.
You could also think about storing the images as BLOB in a database.
You can map an external directory outside Tomcat within server.xml to store the images.
Use the <Context docBase="/some_path_on_your_machine">
tag for this.
If you use a database, it is recommended to store the path to the image in the database, and the actual image on filesystem.
See this thread What is the best place for storing uploaded images, SQL database or disk file system?
精彩评论