Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

executing servlets in apache tomcat

 
deepak borole
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to execute servlets on apache tomcat 4.1.31.....please tell me the steps to be followed
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did your version of Tomcat not come with documentation?
 
deepak borole
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have copied the class file in
C:\Program Files\Apache Group\Tomcat 4.1\webapps\examples\WEB-INF\classes named HelloWorldExample and hav made entry in the web.xml file as

<servlet>
<servlet-name>HelloWorldExample</servlet-name>
<servlet-class>HelloWorldExample</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloWorldExample</servlet-name>
<url-pattern>/HelloWorldExample</url-pattern>
</servlet-mapping>

and executing it as

http://localhost:8080/examples/HelloWorldExample

but gettin the 404 error
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked the Tomcat logs?
Did you get rid of the examples that ship with Tomcat or did you add your servlet to the existing "examples" app?
If you added it, can you still run the other examples?
If not, have you checked the Tomcat logs to see if your addition blew up the app?

I believe that in Servlet Spec 2.3 compliant apps (which Tomcat 4.1 is) the order of elements in the web.xml file is critical.
If you didn't enter them in the correct order, you should see some Sax parse errors in the logs.

This sounds like more of a Tomcat issue than a servlet one.
Moving.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic