Installing Tomcat

Can run by itself (does not need Apache). Part of the Jakarta development (a loose tool development group for Apache-related stuff).

Needs full jdk not jre, bear this in mind when setting JAVA_HOME...

All kinds of wierd references to Catalina (presumably historic), essentially Catalina = tomcat.

Deploying Servlets to Tomcat

Servlet extends HttpServlet .

an http call:

   //localhost:8080/wibble/servlet/MyServlet
should execute the class file in the following directory:
   /webapps/wibble/WEB-INF/classes/MyServlet.class

Similarly for packages:

   //localhost:8080/wibble/servlet/package.MyServlet
should execute the class file in the following directory:
   /webapps/wibble/WEB-INF/classes/package/MyServlet.class

Notay Very Benay: You will need to start and stop Tomcat for it to reload the class if you've changed it...

Configuring Tomcat to find Servlets

Alternatively, you can get Tomcat to look elsewhere for the servlets.

Reloading servlets on-the-fly

If you have a look at this tutotial (which is a very brief intro to setting up TC):

http://www.moreservlets.com/Using-Tomcat-4.html

About a third of the way down the page, under the section 'Configuring Tomcat' there is a paragraph headed '4. Turn on Servlet Reloading' which details the steps. Essentially, you uncomment/add a line to the XML file in the [tomcathome]\conf\ directory called server.xml at the indicated point in the XML doc and it should work.

Watch the Tomcat server output screen when you recompile and copy the class over to the servlet directory and you should see a line 'WebappClassLoader: Resource '/WEB-INF/classes/SQLRetriever.class' was modified; Date is now: Fri Sep.....' (it sometimes takes a few minutes), this indicates it has identified and reloaded your changed class.

NB this can give a nasty hit to performance

-- MartinHill - 20 Sep 2002

Topic revision: r2 - 2002-11-27 - 17:49:14 - MartinHill
 
AstroGrid Service Click here for the
AstroGrid Service Web
This is the AstroGrid
Development Wiki

This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback