刚开始我的struts配置文件名为struts-front.xml,然后就一直无法跳转到指定页面,报“There is no Action mapped for namespace / and action name”这个错。后来把名称改成标准的struts.xml就正常了。看来这个配置文件命名是有规定的啊,不能随便改,切记!
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN"
"http://struts.apache.org/dtds/struts-2.1.7.dtd">
<struts>
<!-- 前台登录 -->
<package name="user" extends="struts-default" namespace="">
<action name="login" method="" class="loginAction">
<result name="index" type="dispatcher">index.jsp</result>
<result name="error" type="dispatcher">error.jsp</result>
</action>
</package>
</struts>