<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<!-- 动态方法调用 -->
<constant name="struts.enable.DynamicMethodInvocation" value="true" />
<!-- 动态开发模式 -->
<constant name="struts.devMode" value="true" />
<!-- 找不到执行默认的包 -->
<!-- <package name="default" namespace="/" extends="struts-default">
找不到执行默认的action
<default-action-ref name="hello1"></default-action-ref>
<action name="hello1" class="com.qf.action.HelloAction" method="add">
<result name="success">ok.jsp</result>
</action>
</package> -->
<package name="Account" namespace="/" extends="struts-default">
<!-- spring整合Struts2 class处写spring里配置的bean的ID名 -->
<action name="transfer" class="accountAction" method="transfer">
<result>ok.jsp</result>
</action>
<action name="findPage" class="accountAction" method="findPage">
<result>findPage.jsp</result>
</action>
<action name="addAccount" class="accountAction" method="add">
<result type="redirectAction">findPage</result>
</action>
<action name="findById" class="accountAction" method="findById">
<result>updateAccount.jsp</result>
</action>
<action name="updateAccount" class="accountAction" method="update">
<result type="redirectAction">findPage</result>
</action>
<action name="deleteAccount" class="accountAction" method="delete">
<result type="redirectAction">findPage</result>
</action>
</package>
</struts>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<!-- 动态方法调用 -->
<constant name="struts.enable.DynamicMethodInvocation" value="true" />
<!-- 动态开发模式 -->
<constant name="struts.devMode" value="true" />
<!-- 找不到执行默认的包 -->
<!-- <package name="default" namespace="/" extends="struts-default">
找不到执行默认的action
<default-action-ref name="hello1"></default-action-ref>
<action name="hello1" class="com.qf.action.HelloAction" method="add">
<result name="success">ok.jsp</result>
</action>
</package> -->
<package name="Account" namespace="/" extends="struts-default">
<!-- spring整合Struts2 class处写spring里配置的bean的ID名 -->
<action name="transfer" class="accountAction" method="transfer">
<result>ok.jsp</result>
</action>
<action name="findPage" class="accountAction" method="findPage">
<result>findPage.jsp</result>
</action>
<action name="addAccount" class="accountAction" method="add">
<result type="redirectAction">findPage</result>
</action>
<action name="findById" class="accountAction" method="findById">
<result>updateAccount.jsp</result>
</action>
<action name="updateAccount" class="accountAction" method="update">
<result type="redirectAction">findPage</result>
</action>
<action name="deleteAccount" class="accountAction" method="delete">
<result type="redirectAction">findPage</result>
</action>
</package>
</struts>