Hi Chuck,

thanks for your reply. Could you please give me a more detailed example?

How can I define a new webapp that is not directly available in the browser (to 
prevent the files from being downloaded without a valid session - maybe limit 
the access to requests from localhost?!) and how can a forward the request in 
one webapp the other one?

Regards
  Jan

-----Ursprüngliche Nachricht-----
Von: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Gesendet: Mittwoch, 8. Juli 2009 15:36
An: Tomcat Users List
Betreff: RE: Serving "static user generated" content

> 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


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to