- This topic has 1 reply, 2 voices, and was last updated 17 years, 10 months ago by Riyad Kalla.
-
AuthorPosts
-
awebproMemberProblem: 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” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” version=”2.4″ xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd”>
<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”>
<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” prefix=”bean” %>
<%@ taglib uri=”http://jakarta.apache.org/struts/tags-html” prefix=”html” %>
<%@ taglib uri=”http://jakarta.apache.org/struts/tags-logic” prefix=”logic” %>
<%@ taglib uri=”http://jakarta.apache.org/struts/tags-tiles” prefix=”tiles” %>
<%@ taglib uri=”http://jakarta.apache.org/struts/tags-template” prefix=”template” %>
<%@ taglib uri=”http://jakarta.apache.org/struts/tags-nested” 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>
Riyad KallaMemberIf 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?)
-
AuthorPosts