• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Avoiding "Directory Listing For xyz" for a Web Application

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have been working on jboss for quite some time. the HOT Deployment feature is simple amazing.

But Am worried about one thing. i have a simple web application. with few html , jsp's and servlets.

let us take the following directory structure for my Simple.war application.

Simple.war
|
|--Jsps/One.jsp
|--WEB-INF/


when i point my browser to localhost:8080/Simple/Jsps

i get the Directory listing of files available in my public folder(Files out side WEB-INF) of my application

is there any way to prevent exposing my public files like, html pages, jsp's and few images i have used in my application.

if i give "localhost:8080/Simple/Jsps" then my browser should display some message other than displaying the directory Listings

Thanks!!!
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you can. There's a web.xml under %JBOSS_HOME%\server\default\deploy\jbossweb-tomcatxxx.sar\conf folder. Change the value of the 'listings' param for the default servlet to false:



By default, the value is true.
 
Naresh Shaan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks A Lot JaiKiran!!!
 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i had the same problem. But after changing it to false it didn't solved my problem. help me
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where did you change that value? Which file in which folder? Post the contents of the changed file. And did you restart the server after the changes?
 
No holds barred. And no bars holed. Except this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic