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 Status 404 - Servlet cz is not available Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "HTTP Status 404 - Servlet cz is not available" Watch "HTTP Status 404 - Servlet cz is not available" New topic
Author

HTTP Status 404 - Servlet cz is not available

c rain
Greenhorn

Joined: Jul 04, 2004
Posts: 1
Hi, All,

I'm trying to build a simple struts web application. I have a loginForm.java and loginAction.java, login.jsp together with some other JSP's. When I'm in login.jsp, and click on the SUBMIT, i got HTTP Status 404 - Servlet cz is not available erroring out. The following is my web.xml and struts-default file.


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

<!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>cz</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>resources.ApplicationResources</param-value>
</init-param>
<init-param>
<param-name>mapping</param-name>
<param-value>org.apache.struts.action.RequestActionMapping</param-value>
</init-param>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/conf/struts-default.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>

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

<!-- Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>cz</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

<!-- Struts Tag Library Descriptors -->
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/WEB-INF/struts-template.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-template.tld</taglib-location>
</taglib>

</web-app>

=========================================================
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts-config (View Source for full doctype...)>
<struts-config>
<form-beans>
<form-bean name="loginForm" type="login.LoginForm" />
</form-beans>

<global-forwards>
<forward name="error" path="/error.jsp" />
</global-forwards>

<action-mappings>
<action path="/login"
type="login.LoginAction"
scope="request"
validate="false"
parameter="method">
<forward name="success" path="/login.jsp" />
</action>
</action-mappings>


<controller processorClass="org.apache.struts.action.RequestProcessor" />
<message-resources parameter="resources.ApplicationResources" null="false" />
</struts-config>



Thank you guys. Any help is appreciated.

cc
poornima balagopal
Ranch Hand

Joined: Dec 02, 2003
Posts: 83
Hi,
change your actionServlet mapping as

<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
and
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>/do/*</url-pattern>
</servlet-mapping>

I dont know is there any problem if you change the servlet name from action to something else . That i have to find out
Anyway try like this
All the best
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP Status 404 - Servlet cz is not available