Servlets and downloading files
I want t开发者_StackOverflowo download an image file using a javascript client. Then I want to call the servlet in apache tomcat from the applet.
How do I host the file on tomcat. i.e. the same as hosting it in the 'docroot' folder on regular webserver?
Just drop the file in a subfolder of the /webapps
folder. E.g. Tomcat/webapps/images/foo.png
. It'll be available by http://localhost:8080/image/foo.png. Or if you already have a webapp, just drop it in the web folder (there where you also put your JSP files and where the /WEB-INF
folder is also present).
精彩评论