You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Richard Scales <Ri...@cobwebsolutions.com> on 2001/03/02 10:13:49 UTC
Servlet Directory
Hi,
I've just installed tomcat 3.2.1 and its working fine except that I am using
the default webapps/examples directory to store my servlets which is a pain
as I physically have to copy them over etc and I would like to keep them on
a seperate folder somewhere else on my machine.
I have been trying to achieve this by adding a contex-path to the server.xml
file with no luck. Currently my servlets are in
H:\jakarta-tomcat-3.2.1\webapps\examples\WEB-INF\classes and I would like to
store them in
H:\Work\MyServlets\bin
I cannot work out how to change this directory this is as far as I have
got:-
<Context path="/myservlets"
docBase="../../Work/MyServlets/bin"
crossContext="false"
debug="0"
reloadable="true" >
</Context>
This does not work and I cannot work out why!
Can anyone help?
Thanks Richard
Re: Servlet Directory
Posted by Match Grun <ma...@dimensional.com>.
I do this all the time. I assume that the /Work/MyServlets/bin contains
a WEB-INF directory. docBase should be set to the directory which
contains the WEB-INF directory. Tomcat looks in the WEB-INF/classes
directory for any class files.
Match
Richard Scales wrote:
>
> Hi,
>
> I've just installed tomcat 3.2.1 and its working fine except that I am using
> the default webapps/examples directory to store my servlets which is a pain
> as I physically have to copy them over etc and I would like to keep them on
> a seperate folder somewhere else on my machine.
>
> I have been trying to achieve this by adding a contex-path to the server.xml
> file with no luck. Currently my servlets are in
> H:\jakarta-tomcat-3.2.1\webapps\examples\WEB-INF\classes and I would like to
> store them in
> H:\Work\MyServlets\bin
>
> I cannot work out how to change this directory this is as far as I have
> got:-
>
> <Context path="/myservlets"
> docBase="../../Work/MyServlets/bin"
> crossContext="false"
> debug="0"
> reloadable="true" >
> </Context>
>
> This does not work and I cannot work out why!
> Can anyone help?
>
> Thanks Richard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-user-help@jakarta.apache.org
Re: Servlet Directory
Posted by Anuj Agrawal <ag...@lucent.com>.
Adding a context path in server.xml is just one part to it (BTW, in docBase you
might want to use a fully qualified path rather than a relative path).
The 2nd file that you need to edit is uriworkermap.properties file, and add (in
your case)
/myservlets/*=ajp12
You may need to restart both Tomcat and the web server.
Good luck.
Anuj.
Richard Scales wrote:
> I've just installed tomcat 3.2.1 and its working fine except that I am using
> the default webapps/examples directory to store my servlets which is a pain
> as I physically have to copy them over etc and I would like to keep them on
> a seperate folder somewhere else on my machine.
>
> I have been trying to achieve this by adding a contex-path to the server.xml
> file with no luck. Currently my servlets are in
> H:\jakarta-tomcat-3.2.1\webapps\examples\WEB-INF\classes and I would like to
> store them in
> H:\Work\MyServlets\bin