directory access restriction
i am building a web application using tomcat.
my directory structure is like this :
webapps/
myapp/
images/
data/
dialog/
i have a index.html in my myapp directory. so no problem here. but when user type this the url textfield :
localhost:8080/myapp/dialog/
he is able to see a list of all the file under the dialog directory.
yes, i want to let user use / access the files file in dialog directory through my application. but i do not want to let them see from browser.
how shld i do it. any configuration i need to do ?
pls help.
thanks
[639 byte] By [
Zerg2000] at [2007-9-26 2:51:29]

Hi,
You can very well go for form based authentication.
Please configure the web.xml under the directory
TOMCAT_HOME/webapps/examples/WEB-INF. There you can define the login configuration.
Please configure the web.xml under the directory
TOMCAT_HOME/webapps/examples/WEB-INF. There you can define the login configuration.
<security-constraint>
<web-resource-collection>
<web-resource-name> Protected Area </web-resource-name>
<!-- Define the URL to be protected -->
<url-pattern>/myapp/dialog/*</url-pattern>
<!-- If you list http methods only those methods are protected -->
<http-method>DELETE</http-method>
<http-method>GET</http-method>
</web-resource-collection>
Then tomcat comes with a security provider that keeps its usernames, passwords
and roles stored in XML file called tomcat-users.xml in TOMCAT_HOME/conf directory.
<tomcat-users>
<user name="tomcat" password="tomcat" roles="tomcat" />
</tomcat-users>
I hope this will help you.
Thanks
Bakrudeen