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

Web application

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

can any one help me out in restricting the folder access from the client browser in a typical web application.

Quick help is appreciated.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ravikanth Reddy Bapathi:
... Quick help is appreciated.



The best way to get quick help is to ask a well formed question.

Can you describe, in a little more detail, what it is that you're trying to do?
[ June 24, 2008: Message edited by: Ben Souther ]
 
Ravikanth Reddy Bapathi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to restrict the user from viewing all the folders and jsp's in my web application.
He should be able to navigate into the application only through the URL provided by me.

I would like to restrict him navigating into the application through the web context.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Most (all, that I know of) containers have configuration settings that allow you to disable directory browsing. Take a look at the documentation for the one that you're using.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For example, in the Tomcat default web.xml which controls the default servlet, you can define:


Bill
 
Ravikanth Reddy Bapathi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where should I give these parameters,
init param's are specified for the servlet, if i am not wrong.

Could you please elaborate.

My requirement is when i click on http://localhost:8080/<web-context>/
I am able to see all the folders and files present in the context.

I want these listings to be invisible when ever client hits the url.

[I am using Jboss 4.0.2 for deploying my app]

Thanks.
[ June 24, 2008: Message edited by: Ravikanth Reddy Bapathi ]
 
Ravikanth Reddy Bapathi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
williams, thanks i found it.

I could able to do that by changing the below code

<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

in web.xml of tomcat.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic