当前位置: 代码迷 >> Java Web开发 >> △△△△这是什么原因 找了两天了没找到原因The requested resource is not available,该怎么处理
  详细解决方案

△△△△这是什么原因 找了两天了没找到原因The requested resource is not available,该怎么处理

热度:9193   发布时间:2013-02-25 21:18:01.0
△△△△这是什么原因 找了两天了没找到原因The requested resource is not available
我是日文系统,大家凑乎着看吧,我怕我翻译过来翻译的不准确
----
再login.jsp我点击提交按钮出现如下错误
提示错误如下

HTTPステータス 404 - パス {0} に対するリクエストは無効です

--------------------------------------------------------------------------------

type ステータスレポート

メッセージ パス {0} に対するリクエストは無効です

説明 The requested resource (パス {0} に対するリクエストは無効です) is not available.
————————————————————————————————————————————————

web.xml
------
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" 
xmlns="http://java.sun.com/xml/ns/j2ee" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
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>2</param-value>
  </init-param>
  <init-param>
  <param-name>detail</param-name>
  <param-value>2</param-value>
  </init-param>
  <load-on-startup>2</load-on-startup>
  </servlet>


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

</web-app>
-----------------
struts
--------
<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC
  "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
  "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">

<struts-config>
<form-beans>
<form-bean name="LoginActionForm" type="pg.ssh.web.forms.LoginActionForm"/>
</form-beans>


  <action-mappings >
  <action
  path="/Xlogin"
  scope="request"
  type="pg.ssh.web.actions.LoginAction"
  name="LoginActionForm"
  >
  <forward name="sucess" path="/login_sucess.jsp" />
  <forward name="erro" path="/index.jsp" />
  </action>

  </action-mappings>


  <message-resources parameter="MessageResources" />


</struts-config>

------------------
login.jsp
------------
<body>
<form action="XLogin.do" method="post">
user<input type="text" name="username"><br>
passsword<input type="password" name="passwrod"><br>
<input type="submit" value="確認">
</form>
</body>
</html>
----------
action
--
public class LoginAction extends Action {

public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
// TODO Auto-generated method stub
LoginActionForm laf=(LoginActionForm)form;
  相关解决方案