You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Raueber Hotzenplotz <fo...@yahoo.co.uk> on 2005/05/11 20:25:37 UTC

Want to run servlets from other directory than webapps

Hi

I've got Tomcat-5.0.27-r5 installed. Running servlets
(localhost) located in
/opt/tomcat5/webapps/ROOT/WEB_INF/classes is no
problem.

What do I need to do to run servlets from my user
directory (e.g. /home/user/myapp)?

I've tried to use http://localhost:8080/admin to add
an additional context, setting path and docbase to
/home/user/myapp, but this doesn't work. 

I've also tried to change appbase to /home/user/myapp
in conf/server.xml, but again no success.

I've uncommented the 'invoker' lines in conf/web.xml -
for the moment anyway:

    <servlet>
        <servlet-name>invoker</servlet-name>
        <servlet-class>
          org.apache.catalina.servlets.InvokerServlet
        </servlet-class>
        <init-param>
            <param-name>debug</param-name>
            <param-value>0</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>invoker</servlet-name>
        <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>


How do you configure Tomcat? Do you use the admin tool
or do you do it manually? The admin tool works strange
e.g. after deleting some context it was still in the
list.

Thanks!

Regards, Rudi



		
___________________________________________________________ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com

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


Re: Want to run servlets from other directory than webapps

Posted by Raueber Hotzenplotz <fo...@yahoo.co.uk>.
I'm running Tomcat as standalone server at the moment
- that could change later on.

What's the preferred way in Tomcat 5?

Thanks!

--- Oto Bossert <o....@gmail.com> wrote:

> Yoo,
> 
> Do you use tomcat stand-alone? Or with Apache....
> 
> Putting a context in server.xml should work, but
> this is not the
> prevered way in tomcat 5!
> 
> Greetings O.
> 
> 
> On 5/11/05, Raueber Hotzenplotz
> <fo...@yahoo.co.uk> wrote:
> > Hi
> > 
> > I've got Tomcat-5.0.27-r5 installed. Running
> servlets
> > (localhost) located in
> > /opt/tomcat5/webapps/ROOT/WEB_INF/classes is no
> > problem.
> > 
> > What do I need to do to run servlets from my user
> > directory (e.g. /home/user/myapp)?
> > 
> > I've tried to use http://localhost:8080/admin to
> add
> > an additional context, setting path and docbase to
> > /home/user/myapp, but this doesn't work.
> > 
> > I've also tried to change appbase to
> /home/user/myapp
> > in conf/server.xml, but again no success.
> > 
> > I've uncommented the 'invoker' lines in
> conf/web.xml -
> > for the moment anyway:
> > 
> >     <servlet>
> >         <servlet-name>invoker</servlet-name>
> >         <servlet-class>
> >          
> org.apache.catalina.servlets.InvokerServlet
> >         </servlet-class>
> >         <init-param>
> >             <param-name>debug</param-name>
> >             <param-value>0</param-value>
> >         </init-param>
> >         <load-on-startup>2</load-on-startup>
> >     </servlet>
> > 
> >     <servlet-mapping>
> >         <servlet-name>invoker</servlet-name>
> >         <url-pattern>/servlet/*</url-pattern>
> >     </servlet-mapping>
> > 
> > How do you configure Tomcat? Do you use the admin
> tool
> > or do you do it manually? The admin tool works
> strange
> > e.g. after deleting some context it was still in
> the
> > list.
> > 
> > Thanks!
> > 
> > Regards, Rudi
> > 
> > 
> >
>
___________________________________________________________
> > How much free photo storage do you get? Store your
> holiday
> > snaps for FREE with Yahoo! Photos
> http://uk.photos.yahoo.com
> > 
> >
>
---------------------------------------------------------------------
> > 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
> 
> 



		
___________________________________________________________ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com

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


Re: Want to run servlets from other directory than webapps

Posted by Oto Bossert <o....@gmail.com>.
Yoo,

Do you use tomcat stand-alone? Or with Apache....

Putting a context in server.xml should work, but this is not the
prevered way in tomcat 5!

Greetings O.


On 5/11/05, Raueber Hotzenplotz <fo...@yahoo.co.uk> wrote:
> Hi
> 
> I've got Tomcat-5.0.27-r5 installed. Running servlets
> (localhost) located in
> /opt/tomcat5/webapps/ROOT/WEB_INF/classes is no
> problem.
> 
> What do I need to do to run servlets from my user
> directory (e.g. /home/user/myapp)?
> 
> I've tried to use http://localhost:8080/admin to add
> an additional context, setting path and docbase to
> /home/user/myapp, but this doesn't work.
> 
> I've also tried to change appbase to /home/user/myapp
> in conf/server.xml, but again no success.
> 
> I've uncommented the 'invoker' lines in conf/web.xml -
> for the moment anyway:
> 
>     <servlet>
>         <servlet-name>invoker</servlet-name>
>         <servlet-class>
>           org.apache.catalina.servlets.InvokerServlet
>         </servlet-class>
>         <init-param>
>             <param-name>debug</param-name>
>             <param-value>0</param-value>
>         </init-param>
>         <load-on-startup>2</load-on-startup>
>     </servlet>
> 
>     <servlet-mapping>
>         <servlet-name>invoker</servlet-name>
>         <url-pattern>/servlet/*</url-pattern>
>     </servlet-mapping>
> 
> How do you configure Tomcat? Do you use the admin tool
> or do you do it manually? The admin tool works strange
> e.g. after deleting some context it was still in the
> list.
> 
> Thanks!
> 
> Regards, Rudi
> 
> 
> ___________________________________________________________
> How much free photo storage do you get? Store your holiday
> snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
> 
> ---------------------------------------------------------------------
> 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: Want to run servlets from other directory than webapps

Posted by Raueber Hotzenplotz <fo...@yahoo.co.uk>.
Thanks PST! Will try it out tomorrow.

Rudi

--- Patrick Thomas <ps...@gmail.com> wrote:

> Hi Rudi,
> 
> Here's how I do it, and this also seems to be the
> 'correct' way of
> doing it with Tomcat5 (as it doesn't mean messing
> with any
> container-level files).
> 
> Into {tomcathome}\conf\Catalina\localhost\ I place a
> correctly formed
> context file,  for example ApplicationName.xml (very
> minimal for
> demonstration purposes... you could, of course, make
> it do whatever a
> normal context file would).
> 
> -------- ApplicationName.xml -----
> <?xml version="1.0" encoding="UTF-8"?>
> 
> <Context path="/ApplicationName"
> docBase="C:/share/ApplicationCode/"
> debug="1" reloadable="true">
> </Context>
> ------- End ApplicationName.xml ----
> 
> The C:/share/ApplicationCode/ directory would
> contain the JSPs, the
> META-INF dir, the WEB-INF dir, etc. Restart your
> tomcat Server and
> away you go. You can even use the admin utility to
> tweak it.
> 
> Cheers,
> PST
> 
> On 5/11/05, Raueber Hotzenplotz
> <fo...@yahoo.co.uk> wrote:
> > Hi
> > 
> > I've got Tomcat-5.0.27-r5 installed. Running
> servlets
> > (localhost) located in
> > /opt/tomcat5/webapps/ROOT/WEB_INF/classes is no
> > problem.
> > 
> > What do I need to do to run servlets from my user
> > directory (e.g. /home/user/myapp)?
> > 
> > I've tried to use http://localhost:8080/admin to
> add
> > an additional context, setting path and docbase to
> > /home/user/myapp, but this doesn't work.
> > 
> > I've also tried to change appbase to
> /home/user/myapp
> > in conf/server.xml, but again no success.
> > 
> > I've uncommented the 'invoker' lines in
> conf/web.xml -
> > for the moment anyway:
> > 
> >    <servlet>
> >        <servlet-name>invoker</servlet-name>
> >        <servlet-class>
> >         
> org.apache.catalina.servlets.InvokerServlet
> >        </servlet-class>
> >        <init-param>
> >            <param-name>debug</param-name>
> >            <param-value>0</param-value>
> >        </init-param>
> >        <load-on-startup>2</load-on-startup>
> >    </servlet>
> > 
> >    <servlet-mapping>
> >        <servlet-name>invoker</servlet-name>
> >        <url-pattern>/servlet/*</url-pattern>
> >    </servlet-mapping>
> > 
> > How do you configure Tomcat? Do you use the admin
> tool
> > or do you do it manually? The admin tool works
> strange
> > e.g. after deleting some context it was still in
> the
> > list.
> > 
> > Thanks!
> > 
> > Regards, Rudi
> > 
> > 
> >
>
___________________________________________________________
> > How much free photo storage do you get? Store your
> holiday
> > snaps for FREE with Yahoo! Photos
> http://uk.photos.yahoo.com
> > 
> >
>
---------------------------------------------------------------------
> > 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
> 
> 



		
___________________________________________________________ 
Does your mail provider give you FREE antivirus protection? 
Get Yahoo! Mail http://uk.mail.yahoo.com

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


Re: Want to run servlets from other directory than webapps

Posted by Patrick Thomas <ps...@gmail.com>.
Hi Rudi,

Here's how I do it, and this also seems to be the 'correct' way of
doing it with Tomcat5 (as it doesn't mean messing with any
container-level files).

Into {tomcathome}\conf\Catalina\localhost\ I place a correctly formed
context file,  for example ApplicationName.xml (very minimal for
demonstration purposes... you could, of course, make it do whatever a
normal context file would).

-------- ApplicationName.xml -----
<?xml version="1.0" encoding="UTF-8"?>

<Context path="/ApplicationName" docBase="C:/share/ApplicationCode/"
debug="1" reloadable="true">
</Context>
------- End ApplicationName.xml ----

The C:/share/ApplicationCode/ directory would contain the JSPs, the
META-INF dir, the WEB-INF dir, etc. Restart your tomcat Server and
away you go. You can even use the admin utility to tweak it.

Cheers,
PST

On 5/11/05, Raueber Hotzenplotz <fo...@yahoo.co.uk> wrote:
> Hi
> 
> I've got Tomcat-5.0.27-r5 installed. Running servlets
> (localhost) located in
> /opt/tomcat5/webapps/ROOT/WEB_INF/classes is no
> problem.
> 
> What do I need to do to run servlets from my user
> directory (e.g. /home/user/myapp)?
> 
> I've tried to use http://localhost:8080/admin to add
> an additional context, setting path and docbase to
> /home/user/myapp, but this doesn't work.
> 
> I've also tried to change appbase to /home/user/myapp
> in conf/server.xml, but again no success.
> 
> I've uncommented the 'invoker' lines in conf/web.xml -
> for the moment anyway:
> 
>    <servlet>
>        <servlet-name>invoker</servlet-name>
>        <servlet-class>
>          org.apache.catalina.servlets.InvokerServlet
>        </servlet-class>
>        <init-param>
>            <param-name>debug</param-name>
>            <param-value>0</param-value>
>        </init-param>
>        <load-on-startup>2</load-on-startup>
>    </servlet>
> 
>    <servlet-mapping>
>        <servlet-name>invoker</servlet-name>
>        <url-pattern>/servlet/*</url-pattern>
>    </servlet-mapping>
> 
> How do you configure Tomcat? Do you use the admin tool
> or do you do it manually? The admin tool works strange
> e.g. after deleting some context it was still in the
> list.
> 
> Thanks!
> 
> Regards, Rudi
> 
> 
> ___________________________________________________________
> How much free photo storage do you get? Store your holiday
> snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
> 
> ---------------------------------------------------------------------
> 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