You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Burkard Endres <bE...@i-te.com> on 2001/06/11 11:58:08 UTC

jsps and servlets in same context?

Hi

i want my servlets and my jsps be served out of the same directory.
this means:
the servlet shoud be mapped to a folder so that they are accessible via:
/myfolder/myservlet
the jsps should also be accessible via
/myfolder/myjsp.jsp

if i copy the jsps in the /myfolder/... it works if i provide the full
path to the jsps
but if i access only /myfolder/ i recieve a directorylisting where i can
download
my jsps in sourcecode and this is of course not acceptable.

Kind regards

Burkard Endres

i-te systems GmbH
Wilhelm-Dahl-Strasse 16
97082 Wuerzburg
Germany


Re: jsps and servlets in same context?

Posted by Milt Epstein <me...@uiuc.edu>.
On Mon, 11 Jun 2001, Burkard Endres wrote:

> Hi
>
> i want my servlets and my jsps be served out of the same directory.
> this means:
> the servlet shoud be mapped to a folder so that they are accessible via:
> /myfolder/myservlet
> the jsps should also be accessible via
> /myfolder/myjsp.jsp
>
> if i copy the jsps in the /myfolder/... it works if i provide the full
> path to the jsps
> but if i access only /myfolder/ i recieve a directorylisting where i can
> download
> my jsps in sourcecode and this is of course not acceptable.

Use the welcome-file facility of the web.xml, and/or put Directory
directives in the tomcat/apache conf file to tell it not to show the
index.  See the sample tomcat/apache conf file for a model of how to
do it.

Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
mepstein@uiuc.edu