This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Learn Java with Math: Using Fun Projects and Games and have Ron Dai on-line!
See this thread for details.
Win a copy of Learn Java with Math: Using Fun Projects and Games this week in the Beginning Java forum!
  • 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
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Avoiding "Directory Listing For xyz" for a Web Application

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Thanks A Lot JaiKiran!!!
 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • 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
  • 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?
 
They gave me pumpkin ice cream. It was not pumpkin pie ice cream. Wiping my tongue on this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!