> From: Jan Jonas [mailto:j...@learnbit.com] > Subject: Serving "static user generated" content > > Is there an elegant way to server files that are not stored > in the webapps directory (something like a RequestDispatcher > for files in the file system)?
You can configure an additional <Context> in conf/Catalina/[host]/[newAppName].xml with a docBase attribute that points to the external location. Rather than serving files directly, your servlet can then just forward (or redirect) the appropriate requests to this "webapp", and let Tomcat's DefaultServlet do all the dirty work. The newAppName "webapp" will not need WEB-INF or META-INF to function. > Is there a way to protect a directory from being overridden > when deploying the war file? This directory then could be > used to store the content and a filter could check the session. Not needed if you use the above scheme. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org