This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Tomcat and the fly likes restricted files access using apache/jakarta tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "restricted files access using apache/jakarta tomcat" Watch "restricted files access using apache/jakarta tomcat" New topic
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
    
    1
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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: restricted files access using apache/jakarta tomcat
 
Similar Threads
Tomcat Installation
Perl/Cgi in Tomcat 5.5
Is WEB-INF Directory mandatory ?
placing JSP files in user application
images in servlet