| Author |
Sorting directory listings
|
Leo Budima
Greenhorn
Joined: Jun 06, 2005
Posts: 10
|
|
Tomcat doesn't sort directory listings in my application at all, is there a way to affect this so that subdirs are shown first as usual? I know that default servlet manages this but I haven't found a way to affect this Thanks!
|
 |
Joseph Marques
Greenhorn
Joined: May 01, 2005
Posts: 12
|
|
What do you mean that "Tomcat" isn't sorting your directories? Are you trying to execute a piece of code, and that code isn't returning the directories in the order you desire? If so, please post the code fragment and I'll try to help. -joe
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56152
|
|
I believe that Leo is referring to the directory listing that is generated when a folder is referenced that doesn't contain any of the "start pages" (index.html, index.jsp, et al). What do yo mean by
doesn't sort directory listings in my application at all
? My Tomcat installation correctly shows the files and folders in alphabetical order.
is there a way to affect this so that subdirs are shown first as usual?
This is hardly "as usual". Other than in the Windows File Explorer I know of nowhere that folders are bunched up at the top of a listing. You could always write your own if you are unhappy with the correct sort order of the default servlet. [ July 06, 2005: Message edited by: Bear Bibeault ]
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Leo Budima
Greenhorn
Joined: Jun 06, 2005
Posts: 10
|
|
Sorry if I wasn't clear enough, my apologies. Yes, as Bear said, I was refering to a situation where Tomcat's default servlet lists current directory contents when there is no welcome page. I'm using globalXsltFile to style directory listing and showing this as a download page in my application. However, subdirectories are shown among the other files and the files are not sorted alphabetically at all which is pretty unconvenient. It has nothing to do with the fact that I'm using my own xslt file since it's the same when I use the default behaviour. Do you think that this is a configuration or installation problem in my specific case? The only way to change sorting generaly would be to rewrite the default servlet? Thank you
|
 |
 |
|
|
subject: Sorting directory listings
|
|
|