• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sorting directory listings

 
Leo Budima
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Leo Budima
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic