Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

RE: Application specific directory listings not working as expected

Caldarale, Charles R

2007-01-08

Replies:

> From: roland.lammel@(protected)
> Subject: Application specific directory listings not working
> as expected
>
> The idea is the configure a "application specific" default
> servlet (simply copy from tomcat's web.xml), change the
> servlet name and add a servlet mapping for the specific
> directory to be allowed for listing.

I think the problem with the above is that the DefaultServlet does not
include the <url-pattern> when retrieving static resources, including
directory listings. Consequently, the desired directory is never
actually found, resulting in the 404 status.

> <servlet-mapping>
>   <servlet-name>MyListing</servlet-name>
>   <url-pattern>/myappdir/</url-pattern>
> </servlet-mapping>

Try changing the <url-pattern> above to just a single slash; this should
get you the listings you need, although it does open up all of the
directories of your app that don't have welcome files and aren't under
WEB-INF. If you really want to give listing access to only a select set
of directories, you may have to place them in a separate webapp.

- 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 start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.