File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes HTTP 404 Not Found Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "HTTP 404 Not Found Error" Watch "HTTP 404 Not Found Error" New topic
Author

HTTP 404 Not Found Error

Bruce Nguyen
Greenhorn

Joined: Apr 28, 2004
Posts: 2
Hi,
I am new to Struts and I am trying to develop a simple program using Struts in Tomcat 4.1. But so far, I have problem with displaying my index.jsp page. Here is the problem:
1. Here is my WEB.xml and I was able to see the index.jsp:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<!-- Action Servlet Configuration -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
</servlet>
<!-- Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
2. However, when I add the Struts tag library to the WEB.xml, I could not see the index.jsp and got the error: HTTP 404 Not Found Error. Here is my WEB.xml after the modification:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<!-- Action Servlet Configuration -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
</servlet>
<!-- Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- Struts Tag Library -->
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/strusts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/strusts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/strusts-logic.tld</taglib-location>
</taglib>
</web-app>
It would be appreciated if someone could tell me what is wrong in my WEB.xml?
Thanks,
Bruce
Ray Stojonic
Ranch Hand

Joined: Aug 08, 2003
Posts: 326
You have some misspellings in your taglibs tags.
This keeps your application from starting, which results in the 404 error.
Either the server window, or the log for your application, should have information about not being able to start and why.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP 404 Not Found Error