aspose file tools*
The moose likes Tomcat and the fly likes restricted files access using apache/jakarta tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Tomcat
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: 12683
    
    5
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://aspose.com/file-tools
 
subject: restricted files access using apache/jakarta tomcat
 
Similar Threads
images in servlet
placing JSP files in user application
Is WEB-INF Directory mandatory ?
Perl/Cgi in Tomcat 5.5
Tomcat Installation