aspose file tools*
The moose likes Tomcat and the fly likes Customisation in Directory Listing 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 "Customisation in Directory Listing " Watch "Customisation in Directory Listing " New topic
Author

Customisation in Directory Listing

Vignesh Babu M.J.
Greenhorn

Joined: May 13, 2008
Posts: 5
Can anyone tell how to do customizing directory listing.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
Seems to me there are two possibilities:
1. Create a custom version of Tomcat's defaultServlet with the desired presentation and set the "listings" parameter to "true". See the conf/web.xml for how this gets configured. You can also use a custom XSLT transform to customise directory listings.

2. Create a custom servlet mapped to a specific URL for only directory listings.

In any case you will be using methods in the java.io.File class - I suggest working with these outside the servlet environment first.

Bill
[ May 13, 2008: Message edited by: William Brogden ]

Java Resources at www.wbrogden.com
Vignesh Babu M.J.
Greenhorn

Joined: May 13, 2008
Posts: 5
Where the default servlet is located in tomcat. If we are creating custom default servlet where we have to put that file, whether in WEB-INF/classes area or anyother location. if possible can you give some sample code for that. that will be helpful for me.
Thanks for your reply.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
The standard Tomcat installation comes with a "class-loader-howto.html" file under ../webapps/docs that tells all about where classes should go for various purposes.

Bill
Vignesh Babu M.J.
Greenhorn

Joined: May 13, 2008
Posts: 5
Thanks William Brogden
Edward He
Greenhorn

Joined: Mar 17, 2004
Posts: 7
you may also want to check out "How do I customize directory listings?"
in page
http://tomcat.apache.org/tomcat-5.5-doc/default-servlet.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Customisation in Directory Listing
 
Similar Threads
Possible to get listing of all files in directory?
Why servlet has 3 names, and not 2???
Prevent directory listing in 5.0 and 5.5
URL... but not specific
set property error?