This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

404 Exception

 
Suhani arora
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to All.....
Frnds I am creating WEB application in which i am using JSP,Servlet,Bean-Class. I have developed it in Tomcat 4.1.10 but due to some reason it is corrupt and now i have installed Tomcat 4.1.31 .After installed i am facing new problem my servlet is not called .It shows 404 Exception servlet not found .any one please tell me why is this happening .I have checked the spelling and Servlet there is not problem.

My WEB.XML is
---------------------------------------------------------------------
<?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/dtd/web-app_2_3.dtd">

<web-app>
<servlet>
<servlet-name>login</servlet-name>
<servlet-class>loginServlet</servlet-class>
<servlet-mapping>
<servlet-name>login</servlet-name>
<url-pattern>servlet/*</url-pattern>
</servlet-mapping>
</servlet>

<security-constraint>
<display-name>Security Constraint</display-name>
<web-resource-collection>
<web-resource-name>USER</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>DELETE</http-method>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
</web-resource-collection>

<auth-constraint>
<role-name>usr</role-name>
<role-name>adm</role-name>
</auth-constraint>

<user-data-constraint><transport-guarantee>NONE</transport-guarantee></user-data-constraint>
</security-constraint>

<login-config>
<auth-method>FORM</auth-method>
<realm-name>Form-Based Authentication</realm-name>
<form-login-config>
<form-login-page>/index.jsp</form-login-page>
<form-error-page>/Error.jsp</form-error-page>
</form-login-config>
</login-config>

<security-role>
<description>Administrator </description>
<role-name>adm</role-name>
</security-role>

<resource-ref>
<description>Connection</description>
<res-ref-name>jdbc/connection</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

</web-app>
--------------------------------------------------------------------
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post some the error message that you are getting.
 
kirtikumar patel
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi!
specify complete path in servlet-class tag in web.xml
and also check url is also written down correcly or not?

if then after u also have same error plz send me (kirti_engineer@rediffmail.com) your class file with web.xm and url those you wirte for access that page in browser
 
Suhani arora
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the Solution Actually there is need to write each servlet and their URL mapping in web.xml and the way is that

<servlet>
<servlet-name>Login</servlet-name>
<servlet-class>User_Entry</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Login</servlet-name>
<url-pattern>/servlet/Login</url-pattern>
</servlet-mapping>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic