• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ROOT directory behavior

 
Jerome Chauveau
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
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic