Hi All,

Yesterday I posted a question to this list under "How to deploy servlets".  I have 
things working now and the steps I followed to get things working are outlined below. 
I would appreciate comments on my approach because I seem to revisit this issue over 
and over and I'm not confident that the approach I used contains all of the necessary 
steps.

Here are the steps I followed to deploy and execute a simple "Hello" servlet in Tomcat 
4.0.4:

1)  Created a servlet name "HelloWorld" in package "hello".
2)  Created a jar containing "hello.HelloWorld.class" named "test.jar".
3)  Created a directory in webapps named "test".
4)  In "test" created the "WEB-INF" directory.
5)  Inside the "WEB-INF" directory created "web.xml".   
6)  In "web.xml" added the following to define the servlet:

  <servlet>
    <servlet-name>hello</servlet-name>
    <servlet-class>hello.HelloWorld</servlet-class>
  </servlet>

7)  Created the "lib" directory under "WEB-INF".
6)  Moved "test.jar" to the lib directory under "WEB-INF".
8)  Started Tomcat and browsed to the servlet using 
"http://localhost:8080/test/servlet/hello";
9)  Incredibly, the browser displayed "Hello World". 

I know there are other ways to accomplish the same thing, i.e., war files or placing 
my classes in the "classes" directory, but this approach works best for the types of 
projects I am working on.  Also, yesterday Jacob Kjome indicated that the 
the default servlet invoker is disabled by default in more recent versions of Tomcat.  
I would appreciate hearing any thoughts as whether or not this will have any impact on 
the approach outlined above.

Thanks to everyone in advance,
Mike


Reply via email to