Flexible use of wildcard characters in struts.xml file

<package name="test0001" namespace="/t01" extends="struts-default">
<action name="*_*" class="com.sk.test.{1}action" method="{2}"><!-- {1}第一个*引用通配符代表_的* -->
<result name="success">/page/hello.jsp</result>
<allowed-methods>login,index,input</allowed-methods>
<!-- 如果访问多个类的时候还要重新写一个action因此使用通配符 -->
<!-- action name ="*_* " class="com.sk.test.{1}action" method="{2}" -->
<!-- allowed-method 里面放入允许的方法所有类的方法 -->
</action>
</package>

Guess you like

Origin blog.csdn.net/weixin_44703894/article/details/111561819