• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 762
  • Last Modified:

servlets not running in tomcat

Hi

   I am working on tomcat for the first time.I have made some servlets,jsps & html files which i want to deploy on tomcat(on win 2003).
 
   I have made a test folder under webapps folder.In test folder i have made WEB-INF folder. In WEB-INF folder , I have made 2 folders ....   classes and lib. I have put all my jsps and htmls files in test folder and  servlets in classes folder. I have made a web.xml file also in WEB-INF folder .  have added  the follwoing line in  /conf/server.xml file

       <Context path="/test" docBase="test" debug="0" reloadable="true" />
The contents of web.xml file are

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">

<web-app>

   <servlet>
            <servlet-name>login</servlet-name>
            <servlet-class>login</servlet-class>
      </servlet>
</web-app>

though i read that one does not need add <servlet> tag if the servlets are without initialisation parameters which my case is.

I have also uncommented the lines swithced on the invoker servlet feature in /conf/web.xml

Still my servlets are not running. jsps and html file are running fine.

HTTP Status 404 - /test/login
type Status report
message /test/login
description The requested resource (/test/login) is not available.

Above error comes.

Any help
Thanks in advance
 

0
rajneesh75
Asked:
rajneesh75
1 Solution
 
petmagdyCommented:

add thid to ur web.xml

  <servlet-mapping>
    <servlet-name>login</servlet-name>
    <url-pattern>/login</url-pattern>
  </servlet-mapping>
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now