tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <>
Subject Re: How to set up a special folder to list all files under it?
Date Mon, 01 Jan 2007 17:08:21 GMT
1)yes you need to setup the listings options for your servlet in web.xml as in 
2)make sure you copy your viewable (txt) files to the the webapps/WEBAPPNAME (Note the WEB-INF
folder is for web.xml, /classes and /lib)
<a href="${contextPath}/src/org/ajaxtags/demo/servlet/">Java
3)ensure the files that you wish to view have an extension that your browser will know to
associate with text editor(as in .txt extension for vi or wordpad)

(Expanding on previous poster's extremely late nite posting..)

This e-mail message (including attachments, if any) is intended for the use of the individual
or entity to which it is addressed and may contain information that is privileged, proprietary
, confidential and exempt from disclosure. If you are not the intended recipient, you are
notified that any dissemination, distribution or copying of this communication is strictly
Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant)
s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé
ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il
est strictement interdit de le diffuser, de le distribuer ou de le reproduire.
----- Original Message ----- 
From: "Caldarale, Charles R" <>
To: "Tomcat Users List" <>
Sent: Monday, January 01, 2007 1:48 AM
Subject: RE: How to set up a special folder to list all files under it?

> From: kkus [] 
> Subject: How to set up a special folder to list all files under it?
> Now I need add a specific folder which will let user to browse
> all files under it without authentication.

I haven't personally tried the following, so take it with a grain of
salt.  Also, others might know an easier way to accomplish what you

Delivery of static content and directory listings is under control of
the default servlet, as defined in the conf/web.xml file.  By default,
this has the listings param set to false, to disable ad hoc browsing.  I
think you could copy the config for the default servlet, change
<servlet-name> from default to something appropriate for your purpose,
set the listings param to true, and add a servlet mapping for this
renamed default to use a <url-pattern> pointing to the directory you
want to store your public files in.  You would want to put this
redefined servlet definition and mapping in the WEB-INF/web.xml of the
webapp that will hold the public directory.

 - Chuck

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 start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message