This week's book giveaway is in the Agile forum.
We're giving away four copies of The Software Craftsman and have Sandro Mancuso on-line!
See this thread for details.
The moose likes Servlets and the fly likes stopping the application from displaying index.jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "stopping the application from displaying index.jsp" Watch "stopping the application from displaying index.jsp" New topic
Author

stopping the application from displaying index.jsp

nikil shar
Ranch Hand

Joined: May 25, 2008
Posts: 116
hi all,
i have a web application "http://localhost:8280/testApp/createStar/....." .

When i enter "http://localhost:8280/testApp/" in the browser, it display the index.jsp. If i remove any reference to index.jsp file from web.xml it starts listing directories on the browser.

How do i make the server return an "Error" when i enter "http://localhost:8280/testApp/"


App server is Glassfish V3 Prelude


thanks in advance.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 62298
    
  68

Don't include an index.jsp, and turn off directory browsing.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
nikil shar
Ranch Hand

Joined: May 25, 2008
Posts: 116
thanks for the reply. How do i turn off directory listing ??


ta.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 62298
    
  68

That will be a Glassfish-specific setting. You'll need to read the docs.

In Tomcat it's an init-param to the default servlet.
 
Consider Paul's rocket mass heater.
 
subject: stopping the application from displaying index.jsp