日期:2014-05-17  浏览次数:20565 次

关于struts1.2的问题
用struts1.2只写了个简单的登录,但是总是404错误。程序和tomcat都没有报错呀,怎么回事,我是初学者,麻烦大家估计下是哪里错了。
Java code
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">

<struts-config>
  <data-sources />
  <form-beans >
    <form-bean name="loginForm" type="mystruts.form.LoginForm" />
  </form-beans>

  <global-exceptions />
  <global-forwards />
  <action-mappings >
    <action
      attribute= "loginForm"
      input= "/login.jsp"
      name= "loginForm"
      path= "/login"    
      scope= "request"
      type= "mystruts.action.LoginAction" >
      <forward name="suc" path="/login_success.jsp" ></forward>
      <forward name="fal" path="/login_failure.jsp" ></forward>         
    </action>
  </action-mappings>
  <message-resources parameter="mystruts.ApplicationResources" />
</struts-config>



------解决方案--------------------
可能路径错了,也可能项目没有在服务器上更新,所有找不到请求的内容,如果都不是,你可以将404剪贴下来看看吗
------解决方案--------------------
java中打断点,<forward name="suc" path="/login_success.jsp" ></forward>,看这段,估计LZ登录成功,路径不存在

------解决方案--------------------
就是路径的错误 看看页面
<forward name="login" path="/../WEB-INF/struts_1/login.jsplogin.jsp" ></forward> 可配了