关于The requested resource is not available这个问题

关于The requested resource is not available这个问题

我是使用struts,对着书上的例子做的。在测试项目时,首页可以出来,就是跳不到登录成功后需要出现的欢迎页。
在网上查了许多方法,都没有解决。自己的xml文件也没有出错,于是怀疑是不是自己form提交的路径出了问题。

原来书上的提交路径是 <form action="/Login/Login.do" method="post"> 经过我无数次的修改,比如变成Login/Login.do,再比如更换xml文件和form路径的大小写,还是不行最后我尝试了Login.do,登录成功后的欢迎页就出来了。 以下是我的struts-config.xml

    <struts-config>
      <data-sources />
      <form-beans >
        <!-- 注册LoginForm.java -->
        <form-bean name="loginForm" type="Login.LoginForm"></form-bean>  
      </form-beans>
      <global-exceptions />
      <global-forwards />
      <action-mappings >
        <!-- 注册Action -->
        <!-- path指提交路径 type指Action的路径 name的值需要与ActionForm的name属性一致 -->
        <action path="/Login" name="loginForm" type="Login.LoginAction"></action>
      </action-mappings>
      <message-resources parameter="strutsTest.ApplicationResources" />
    </struts-config>

猜你喜欢

转载自www.cnblogs.com/ouqdevil/p/9174112.html
今日推荐