facebook

Index page will not forward to an ACTION. Any action.

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #265834 Reply

    awebpro
    Member

    Problem: I have an index page. It has a redirect to an action called ‘courseSearch’. When I load the application, the index page redirects to the action. At least, it used to. Now, it returns a ‘404 http error, Servlet action is not available’ error. If i redirect to a jsp page, it works. I wrote a new action and it wouldn’t work either.

    It was working fine a few days ago and then MyEclipse locked up and then I rebooted the machine. Ever since then, it won’t work. How do I fix this? Please advise.

    Here is my web.xml page
    **********************************************

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <web-app xmlns=”http://java.sun.com/xml/ns/j2ee&#8221; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; version=”2.4″ xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd”&gt;
    <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
    <param-name>debug</param-name>
    <param-value>3</param-value>
    </init-param>
    <init-param>
    <param-name>detail</param-name>
    <param-value>3</param-value>
    </init-param>
    <load-on-startup>0</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    </web-app>

    Here is struts-config file
    ************************************************************

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <!DOCTYPE struts-config PUBLIC “-//Apache Software Foundation//DTD Struts Configuration 1.1//EN” “http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd”&gt;
    <struts-config>

    <form-beans >
    <form-bean name=”courseSearchForm” type=”org.apache.struts.action.DynaActionForm”>
    <form-property name=”instructor” type=”java.lang.String” />
    <form-property name=”courseName” type=”java.lang.String” />
    <form-property name=”courseNumber” type=”java.lang.String” />
    </form-bean>
    <form-bean name=”categoryForm” type=”eclipse.kickstart.struts.form.CategoryForm” />
    <form-bean name=”testForm” type=”eclipse.kickstart.struts.form.TestForm” />

    </form-beans>

    <global-exceptions >
    <exception
    key=”ioe.error”
    path=”/error.jsp”
    type=”java.io.IOException” />

    </global-exceptions>

    <global-forwards >
    <forward name=”unknown” path=”/unknown.jsp” />

    </global-forwards>

    <action-mappings >
    <action
    attribute=”courseSearchForm”
    input=”/courseSearch.jsp”
    name=”courseSearchForm”
    path=”/courseSearch”
    scope=”request”
    type=”eclipse.kickstart.struts.action.CourseSearchAction”>
    <forward name=”success” path=”/page2.jsp” />
    </action>
    <action
    attribute=”categoryForm”
    input=”/page2.jsp”
    name=”categoryForm”
    path=”/category”
    scope=”request”
    type=”eclipse.kickstart.struts.action.CategoryAction”
    validate=”false”>
    <forward name=”yetsuccess” path=”/page3.jsp” />
    <forward name=”nosuccess” path=”/page4.jsp” />
    <forward name=”architecturesuccess” path=”/architecture.jsp” />
    </action>
    <action
    attribute=”testForm”
    input=”/test.jsp”
    name=”testForm”
    path=”/test”
    scope=”request”
    type=”eclipse.kickstart.struts.action.TestAction”
    validate=”false” />

    </action-mappings>

    <message-resources parameter=”eclipse.kickstart.struts.ApplicationResources” />
    </struts-config>

    Here is index.jsp page
    *********************************************************************

    <%@ page language=”java”%>

    <%@ taglib uri=”http://jakarta.apache.org/struts/tags-bean&#8221; prefix=”bean” %>
    <%@ taglib uri=”http://jakarta.apache.org/struts/tags-html&#8221; prefix=”html” %>
    <%@ taglib uri=”http://jakarta.apache.org/struts/tags-logic&#8221; prefix=”logic” %>
    <%@ taglib uri=”http://jakarta.apache.org/struts/tags-tiles&#8221; prefix=”tiles” %>
    <%@ taglib uri=”http://jakarta.apache.org/struts/tags-template&#8221; prefix=”template” %>
    <%@ taglib uri=”http://jakarta.apache.org/struts/tags-nested&#8221; prefix=”nested” %>

    <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
    <html:html locale=”true”>
    <head>
    <html:base />

    <title>index.jsp</title>

    <meta http-equiv=”pragma” content=”no-cache”>
    <meta http-equiv=”cache-control” content=”no-cache”>
    <meta http-equiv=”expires” content=”0″>
    <meta http-equiv=”keywords” content=”keyword1,keyword2,keyword3″>
    <meta http-equiv=”description” content=”This is the index page”>
    </head>

    <body>

    <%– <% response.sendRedirect(“courseSearch”); %> –%>
    <P>new index page</P>
    <% response.sendRedirect(“courseSearch.do”); %>

    </body>
    </html:html>

    #265900 Reply

    Riyad Kalla
    Member

    If this used to work, now it doesn’t work, I would suggest checking your Tomcat console as Tomcat starts up, and see if that specific servlet is failing to start for some reason (for example, maybe it’s throwing an exception during initialization?)

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Index page will not forward to an ACTION. Any action.

You must be logged in to post in the forum log in