• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

ROOT directory behavior

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all.

I create a directory test in webapps/ROOT.
When I go to url http://localhost:8080/test, a listing of the content of this directory is displayed.

Is there a way to have the same thing for directories not located in ROOT dir (for instance, D:/mydirs)?

Thanks in advance,

JC
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Directory listing capability can be controlled on an application basis by an entry in web.xml - find the <servlet> entry for the default servlet and use the listings parameter.

in the default web.xml is what I suggest for security purposes.
Bill
 
Jerome Chauveau
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your answer, Bill.

I stil can get the listing to appear.
What I did :
1 - Created directory t on c:/.
2 - Added
<Context path="/t" docBase="c:/t" crossContext="false" debug="1" reloadable="true" >
</Context>
into server.xml (after </host)
3 - Created WEB-INF direcroty in c:/t.
4 - Created a web.xml file into this directory with the init-param you gave me.

When i type : http://localhost:8080/t, it says : Resource /t was not found.

I think my context definition is not good or misplaced, I've tried several things but cannot get it to work.

Thanks in advance for your help.

JC
[ November 14, 2005: Message edited by: Jerome Chauveau ]
 
Jerome Chauveau
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

I found the solution : the <context> must be between the <host></host>.

And it works fine, thanks again Bill.

JC
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!