tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From H Socks <hairyso...@yahoo.co.uk>
Subject Re: Configuring my own servlets on Tomcat4.0
Date Fri, 22 Feb 2002 13:52:17 GMT
I've also just installed Tomcat 4. I had a bit of 
trouble at first, but got my servlets working in
the examples directory. Then I moved them to my own
application directory.

Things to look for:
1. I put a "package" statement in each servlet. e.g.
   "mywebapp". Make a subdirectory called mywebapp
   on the classes directory for your web application.
2. Set up the web.xml file for the application with
   entries for each servlet. Since they are in
   packages (e.g. package mywebapp;) then they
   will be known as mywebapp.MyServlet (for class
   from MyServlet.java).

   The web.xml file needs lines like these for each
   servlet (replace [ ] with lt and gt brackets):

   [servlet]
     [servlet-name]MyServlet[/servlet-name]
     [servlet-class]mywebapp.MyServlet[/servlet-class]
   [/servlet]

   This then hides the mywebapp subdirectory when the
   servlet is called, and the URL will be

   http://localhost:8080/app_dir/servletMyServlet

This should work!

Rob


 --- Dmitry Nikelshpur <dnikelshpu@yahoo.com> wrote: >
Don't know if your problem is same as what happened
> to me, but you may 
> want to try this:
> Copy your application files into the examples
> directory. You may need to 
> edit the web.xml file accordingly (maybe just for
> one servlet initially).
> See if the servlet is found...If this works then
> just rename the 
> examples directory to whatever and voila....
> 
> Dmitry
> 
> I'll be surprised if this works, but it did the
> trick for me..very wierd 
> stuff though.... :-)
> 
> Sampige, Srinivas wrote:
> 
> >Hi
> > I downloaded Tomcat4.0 just now and insalled it. I
> am able to run the
> >example servlets. When I try to create my own
> servlets OR whehn I try to
> >deploy and run those web apps that were working on
> the older version
> >(Tomcat3.2) the new servlets don't run. Any clues?
> I looked at the
> >documentation but could not find anything.
> >
> >thanks
> >-Srinivas
> >
> >--
> >To unsubscribe:  
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> >For additional commands:
> <mailto:tomcat-user-help@jakarta.apache.org>
> >Troubles with the list:
> <mailto:tomcat-user-owner@jakarta.apache.org>
> >
> >
> >
> 
> 
> 
> --
> To unsubscribe:  
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands:
> <mailto:tomcat-user-help@jakarta.apache.org>
> Troubles with the list:
> <mailto:tomcat-user-owner@jakarta.apache.org>
>  

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message