• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sorting directory listings

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic