struts.xml中 include的文件中的action找不到 10
struts。xml<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEstrutsPUBLIC"-//ApacheSoftware...
struts。xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="../a.xml"></include>
<package name="default" namespace="/" extends="struts-default">
<!-- 全局结果 -->
<global-results>
<result name="success">/success.jsp</result>
</global-results>
<action name="login" class="com.action.LoginAction">
<result type="redirectAction">
<param name="actionName">userLogin</param>
<param name="namespace">/user</param>
</result>
<result name="error" type="redirectAction">error</result>
</action>
<action name="error">
<result>/error.jsp</result>
</action>
</package>
<package name="user" extends="struts-default" namespace="/user">
<action name="userLogin" class="com.action.LoginAction">
<result>/hello.jsp</result>
</action>
</package>
</struts>
a。xml
<struts>
<package name="default" namespace="/" extends="struts-default">
<action name="hello" class="com.action.TestAction">
<result>/success.jsp</result>
</action>
</package>
</struts>
index
<s:a action="../hello">hello</s:a>
<s:a action="login!redirect.action">redirect</s:a> 展开
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="../a.xml"></include>
<package name="default" namespace="/" extends="struts-default">
<!-- 全局结果 -->
<global-results>
<result name="success">/success.jsp</result>
</global-results>
<action name="login" class="com.action.LoginAction">
<result type="redirectAction">
<param name="actionName">userLogin</param>
<param name="namespace">/user</param>
</result>
<result name="error" type="redirectAction">error</result>
</action>
<action name="error">
<result>/error.jsp</result>
</action>
</package>
<package name="user" extends="struts-default" namespace="/user">
<action name="userLogin" class="com.action.LoginAction">
<result>/hello.jsp</result>
</action>
</package>
</struts>
a。xml
<struts>
<package name="default" namespace="/" extends="struts-default">
<action name="hello" class="com.action.TestAction">
<result>/success.jsp</result>
</action>
</package>
</struts>
index
<s:a action="../hello">hello</s:a>
<s:a action="login!redirect.action">redirect</s:a> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询