aspose file tools*
The moose likes Tomcat and the fly likes executing servlets in apache tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "executing servlets in apache tomcat" Watch "executing servlets in apache tomcat" New topic
Author

executing servlets in apache tomcat

deepak borole
Greenhorn

Joined: Nov 13, 2005
Posts: 25
how to execute servlets on apache tomcat 4.1.31.....please tell me the steps to be followed


Winners Dont Do Different Things, They Do Things Differently !!!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

Did your version of Tomcat not come with documentation?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
deepak borole
Greenhorn

Joined: Nov 13, 2005
Posts: 25
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

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: executing servlets in apache tomcat