You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Haller, Joe" <Jo...@purchasepro.com> on 2000/09/19 20:13:26 UTC
Making document root correspond to a context.
How do we configure Tomcat so that the document
root of the web server corresponds to a particular context.
For example, suppose I have a context foo, with JSP bar.jsp,
how do I configure so the following will work:
http://localhost/bar.jsp
Many thanks.
J. Haller
-----Original Message-----
From: Kitching Simon [mailto:Simon.Kitching@orange.ch]
Sent: Tuesday, September 19, 2000 11:08 AM
To: 'tomcat-user@jakarta.apache.org'
Subject: RE: tomat/linux - can't get jsp to work in dir other than
exampl es!
> -----Original Message-----
> From: Shailendra majmundar [SMTP:smaj@Zambeel.com]
> Sent: Tuesday, September 19, 2000 7:39 PM
> To: tomcat-user@jakarta.apache.org
> Subject: tomat/linux - can't get jsp to work in dir other than
> examples!
>
> I can access my servlets after configuring server.xml, but the jsps in
> WEB-INF directory won't work.
> Is there some magic to apache conf that I am missing? I don't see any jsp
> related tags in
> $TOMCAT_HOME/..examples/WEB-INF/web.xml.
>
> It seems to work only in the examples directory.
>
> Thanks
>
[Kitching Simon]
Hi,
I don't know if the above is just a typo, but
just in case it isn't, I'll point out:
jsp files do *not* go in the WEB-INF subdirectory of your
web application's main (root) directory. They go anywhere
you like under your web application's main directory
*except* under WEB-INF.
Servlet classes *do* go in the WEB-INF/classes subdirectory
of your web application's main (root) directory.
And you need to configure apache so that tomcat is invoked
for any URl which:
(a) ends in .jsp, or
(b) matches one of your servlets
It is always recommended that you get things working with
tomcat in "stand-alone" mode, ie without apache, then try
adding apache as a front-end afterwards.
You don't need to put any entries in yourwebapp/WEB-INF/web.xml
related to your jsp files, unless you are trying something really
tricky
like running a page's init function on startup.
Regards,
Simon