You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Paul Taylor <pa...@fastmail.fm> on 2005/01/10 15:21:30 UTC

Preventing directory listings in WebApplication

Hi
How exactly do I stop the user going into directory containing jsps and 
listing all the jsps within it as a directory listing. I dont mind them 
specifying a particular jsp and going straight to that but I would / to 
map to the default page for the particular some section.

i.e
myapp/section1
i want go to myapp/section1/start.jsp

myapp/section2
i want go to myapp/section2/start.jsp

 I guess its something to do with mappings the applications in web.xml 
but I cant get it working.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Preventing directory listings in WebApplication

Posted by epyonne <ep...@hotmail.com>.
There are two ways to do that:
1. Turn off the directory listing in one of the configuration file. But I
cannot remember which one off the top of my head.
2. Put an index.jsp with a generic message in each folder.

Hope this helps.


----- Original Message ----- 
From: "Paul Taylor" <pa...@fastmail.fm>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Monday, January 10, 2005 08:21 AM
Subject: Preventing directory listings in WebApplication


> Hi
> How exactly do I stop the user going into directory containing jsps and
> listing all the jsps within it as a directory listing. I dont mind them
> specifying a particular jsp and going straight to that but I would / to
> map to the default page for the particular some section.
>
> i.e
> myapp/section1
> i want go to myapp/section1/start.jsp
>
> myapp/section2
> i want go to myapp/section2/start.jsp
>
>  I guess its something to do with mappings the applications in web.xml
> but I cant get it working.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Preventing directory listings in WebApplication

Posted by Paul Taylor <pa...@fastmail.fm>.
Ok Ive realised what I was doing wrong I was listing a file on each 
directory
as follows

<welcome-file-list id="WelcomeFileList_1">
   <welcome-file>section1/start.jsp</welcome-file>
   <welcome-file>section2/start.jsp</welcome-file>
</welcome-file-list>

when i just needed to specify the file 

Also you can use it in conjunction with listing =false which I need because some directories do not have a suitable default.

Ben Souther wrote:

>Just before the error page listings in your application's web.xml file.
>
>   4305
>   4306   <welcome-file-list id="WelcomeFileList_1">
>   4307       <welcome-file>index.html</welcome-file>
>   4308       <welcome-file>index.jsp</welcome-file>
>   4308       <welcome-file>start.jsp</welcome-file> <<<<---------
>   4309    </welcome-file-list>
>   4310 <!--
>
>
>
>
>
>
>On Mon, 2005-01-10 at 11:03, Paul Taylor wrote:
>  
>
>>Hi
>>Are these exclusive options. I can disable the listings but cant get the 
>>default pages to work
>>Should the default pages go in the applications web.xml or Tomcats main 
>>web.xml
>>
>>Ben Souther wrote:
>>
>>    
>>
>>>You can add start.jsp to your welcome file list or you can 
>>>set listings to false in the the default servlet entry of 
>>>TOMCAT_HOME/conf/web.xml
>>>
>>>
>>>
>>>On Mon, 2005-01-10 at 09:21, Paul Taylor wrote:
>>> 
>>>
>>>      
>>>
>>>>Hi
>>>>How exactly do I stop the user going into directory containing jsps and 
>>>>listing all the jsps within it as a directory listing. I dont mind them 
>>>>specifying a particular jsp and going straight to that but I would / to 
>>>>map to the default page for the particular some section.
>>>>
>>>>i.e
>>>>myapp/section1
>>>>i want go to myapp/section1/start.jsp
>>>>
>>>>myapp/section2
>>>>i want go to myapp/section2/start.jsp
>>>>
>>>>I guess its something to do with mappings the applications in web.xml 
>>>>but I cant get it working.
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>>>
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>> 
>>>
>>>      
>>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Preventing directory listings in WebApplication

Posted by Ben Souther <bs...@fwdco.com>.
Just before the error page listings in your application's web.xml file.

   4305
   4306   <welcome-file-list id="WelcomeFileList_1">
   4307       <welcome-file>index.html</welcome-file>
   4308       <welcome-file>index.jsp</welcome-file>
   4308       <welcome-file>start.jsp</welcome-file> <<<<---------
   4309    </welcome-file-list>
   4310 <!--






On Mon, 2005-01-10 at 11:03, Paul Taylor wrote:
> Hi
> Are these exclusive options. I can disable the listings but cant get the 
> default pages to work
> Should the default pages go in the applications web.xml or Tomcats main 
> web.xml
> 
> Ben Souther wrote:
> 
> >You can add start.jsp to your welcome file list or you can 
> >set listings to false in the the default servlet entry of 
> >TOMCAT_HOME/conf/web.xml
> >
> >
> >
> >On Mon, 2005-01-10 at 09:21, Paul Taylor wrote:
> >  
> >
> >>Hi
> >>How exactly do I stop the user going into directory containing jsps and 
> >>listing all the jsps within it as a directory listing. I dont mind them 
> >>specifying a particular jsp and going straight to that but I would / to 
> >>map to the default page for the particular some section.
> >>
> >>i.e
> >>myapp/section1
> >>i want go to myapp/section1/start.jsp
> >>
> >>myapp/section2
> >>i want go to myapp/section2/start.jsp
> >>
> >> I guess its something to do with mappings the applications in web.xml 
> >>but I cant get it working.
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >>
> >>
> >>    
> >>
> >
> >
> >  
> >
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org