注意:命名规则
<!-- 注意如果有通配符,先精确匹配action的name属性,如果不能精确匹配,再进行通配,(只要action配置中有通配符所有有通配符根据配置先后进行匹配) -->
Eg1:
<package name="tpf" namespace="/tpf"extends="struts-default" >
<!-- 通配符 -->
<action name="*_*" class="com.etc.web.{1}Action"method="{2}" >
<result >/{1}/{1}-{2}.jsp</result>
</action>
</package>
Eg2:
<package name="tpf" namespace="/tpf"extends="struts-default" >
<!-- 注意如果有通配符,先精确匹配action的name属性然后再进行通配,如果不能精确匹配(只要action配置中有通配符所有有通配符根据配置先后进行匹配) -->
<action name="*"class="com.etc.web.LoginAction" method="register1" >
<result name="success" >/pages/login-login3.jsp</result>
</action>
<action name="*_register1"class="com.etc.web.{1}Action" method="register2" >
<result name="success" >/pages/login-login3.jsp</result>
</action>
<action name="Login_login" class="com.etc.web.LoginAction" method="register" >
<result name="success" >/pages/login-login3.jsp</result>
</action>
</package>