Meaningless Drivel is fun!*
The moose likes JBoss/WildFly and the fly likes Avoiding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Avoiding "Directory Listing For xyz" for a Web Application" Watch "Avoiding "Directory Listing For xyz" for a Web Application" New topic
Author

Avoiding "Directory Listing For xyz" for a Web Application

Naresh Shaan
Greenhorn

Joined: Mar 18, 2006
Posts: 22
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!!!


"The greatest pleasure in life is doing what people say you cannot do." - Walter Bagehot
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9955
    
163

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.


[My Blog] [JavaRanch Journal]
Naresh Shaan
Greenhorn

Joined: Mar 18, 2006
Posts: 22
Thanks A Lot JaiKiran!!!
naveen gupta
Ranch Hand

Joined: Apr 12, 2006
Posts: 129
i had the same problem. But after changing it to false it didn't solved my problem. help me
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9955
    
163

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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Avoiding "Directory Listing For xyz" for a Web Application
 
Similar Threads
Difficulties with setting up Apache tomcat: 'Need a little help.
sendRedirect
Simple HelloServlet not working
Make Tomcat go
404 File not found