• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to run servlet in tomcat

 
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have installed tomcat 4.1 . i can't able to run servlet ...


please help me ...........
 
Ranch Hand
Posts: 489
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to the Apache Tomcat forum.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
reply
    Bookmark Topic Watch Topic
  • New Topic