| Author |
restricted files access using apache/jakarta tomcat
|
sridhar vedhanabatla
Greenhorn
Joined: Feb 21, 2007
Posts: 12
|
|
I need to restrict access to urls having .pdf and .doc file at end. I need to block access to folders. Actually the folder nesting is like A/B/C. Folder C is having .doc and .pdf files. Right now tomcat is allowing access to url http://localhost:8080/A/B and it is showing all files in B folder. url http://localhost:8080/A/B/C is showing all files in folder C. I need to allow url of type http://localhost:8080/A/B/C/*.pdf or http://localhost:8080/A/B/C/*.doc Thanks in advance.
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12325
|
|
Directory displays are handled by the DefaultServlet as configured in the default web.xml file. There are a number of configuration parameters, including "listings" - set that to false and Tomcat will not do any directory listings. You could then handle security and file serving in a custom servlet for that application. You can also create a modified version of DefaultServlet or use XSLT to customize the display generated by DefaultServlet. Bill
|
Java Resources at www.wbrogden.com
|
 |
 |
|
|
subject: restricted files access using apache/jakarta tomcat
|
|
|