Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · Web Hosting Plans · Faisal Khan's Blog · Contact
Forums : J2EE : JSP : Help,I can't run servlet from Tomcat6.0 Signup · Login
Author Thread
Help,I can't run servlet from Tomcat6.0
Posted in tutorial: Introduction to Java Servlets, Developing your first Java Servlet
·  avemaria
User
Joined: 7 Aug 2007
Total Posts: 1
Help,I can't run servlet from Tomcat6.0
Posted: 7 Aug 2007
Hi,Faisal Khan,

I installed jdk1.6.0_01 and Tomcat6.0.13 ,and i can run jsp but not servlet.
I run like yours example but I receive HTTP404 , I also change web.xml like reply from TestServlet class not running in browser with tomcat4.1.18.Can you help me?
·  Faisal Khan
AdminAdminAdminAdmin
Joined: 24 Sep 2002
Total Posts: 547
Re: Help,I can't run servlet from Tomcat6.0
Posted: 27 Oct 2007
You must now deploy your Servlet using web.xml file. I have updated the tutorial to reflect these new changes. Kindly reread the tutorial.

For a quick short answer though, you must have the servlet-mapping tag inserted in the web.xml file:

<servlet-mapping>
<servlet-name>TestServlet</servlet-name>
<url-pattern>/TestServlet</url-pattern>
</servlet-mapping>

Then you will be able to access the TestServlet using /TestServlet URL.

Faisal Khan.
Stardeveloper.com

Users Who Have Visited This Thread In Last 24 Hours
9 Visitors

Login
UserName Or Email Address:       Password:       Auto-Login:    
· Create New User Account
· Send Forgotten Password by Email
 
© 1999 - 2009 Stardeveloper.com, All Rights Reserved.