2012-06-13 88 views
0

我得到提交JSP文件中的以下错误:http状态404 servlet的作用不可

HTTP状态404 - Servlet的作用是不可 型状态报告 消息Servlet的作用是不可 描述请求资源(Servlet操作不可用)不可用。

我的应用程序是这样的:

+ WebAppl
        + SRC
            + com.ss.user.actions.authentication
                  + IndexAction.java
      + JSP
            +的index.jsp
            +的login.jsp
      + WEB-INF
       个    + struts-config.xml中
            +网络的XML
            +等一些其他文件

在index.jsp文件我有一个表格,找如:

<form method="post" action="<%=request.getContextPath()%> /authentication/Index.do"> <input type="submit" value="PressMe"/>
</form>

在struts-confif我已经定义了以下行动: <action path="/authentication/Index" scope="request" type="com.ss.user.actions.authentication.IndexAction"> <forward name="success" path="/jsp/login.jsp" /> </action>

IndexAction.java
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { return mapping.findForward(SUCCESS);}

我知道,错误404的意思是找不到文件,并有可能是在给定的路径是错误的,但我无法弄清楚。谁能帮我?提前致谢。

+0

表单动作属性中是否存在空格?任何你不仅仅使用Struts表单标签的理由? –

+0

空间不在那里,我检查了..我刚发现一个小错误,并改变了“action =”<%= request。getContextPath()%>/authentication/Index.do“>”改为“action =”<%= request.getContextPath()%>/authentication/index.do“>”,它根本不起作用。在Struts表单标记之前使用..不知道它看起来像 – Steffi

+0

,但是如果我只更改表单标记,您认为它会有所作为吗? – Steffi

回答

0

请检查您的.xml文件,如果有一些语法错误,那么你也会看到这个错误。
检查缺少标签/不完整标签。