• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to run servlet in tomcat

 
Thennam Pandian
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have installed tomcat 4.1 . i can't able to run servlet ...


please help me ...........
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

have installed tomcat 4.1


Unless you have a compelling reason, do not work with older versions. If you are using Tomcat to understand and work on j2ee web applications, download the latest version, which is 5.5.12

There is good documentation (atleast for the newbies) in the tomcat site on setting up the first web application. Read it
here.

ram.
 
Manoj Kumkumath
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

i have installed tomcat 4.1 . i can't able to run servlet ...


Can you be more specific about the exception you are getting
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the Apache Tomcat forum.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Thennam Pandian:
i have installed tomcat 4.1 . i can't able to run servlet ...
please help me ...........


Can you explain to us what you have done so far?
Did you write a servlet?
Were you able to compile it?
Where did you put the class file?
Did you create an entry for it in your deployment descriptor (web.xml)?
Did you create a mapping for it in your deployment descriptor?

If the answer to all of the above is "yes", are you seeing error messages; in the browser, in your tomcat logs?
 
payal agrawal
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the URL below:

Setting up a servlet environment
http://www.java-tips.org/content/view/119/74/

web.xml file looks like this

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>Your Servlet name</servlet-name>
<servlet-class>yourservlet class name</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Your Servlet name</servlet-name>
<url-pattern>/servlet/Your Servlet name</url-pattern>
</servlet-mapping>
</web-app>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic