File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

404 Exception

 
Suhani arora
Greenhorn
Posts: 8
  • 0
  • 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>
--------------------------------------------------------------------
 
Shrinivas Mujumdar
Ranch Hand
Posts: 328
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your code there is a line in web.xml

<url-pattern>servlet/*</url-pattern>

In tomcat 4.1 you must specify (/)in url pattern. In short the above line should change to
<url-pattern>/servlet/*</url-pattern>
it will work definitely.

regards
Shrinivas Mujumdar
 
Shrinivas Mujumdar
Ranch Hand
Posts: 328
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your code there is a line in web.xml

<url-pattern>servlet/*</url-pattern>

In tomcat 4.1 you must specify (/)in url pattern. In short the above line should change to
<url-pattern>/servlet/*</url-pattern>
it will work definitely.

regards
Shrinivas Mujumdar
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic