<struts>
<package name="sss" extends="struts-default" namespace="/">
<global-allowed-methods>bins,shout</global-allowed-methods>
<action name="bin_*" class="com.bin.action.BinAction" method="{1}">
<result name="{1}">/{1}.jsp</result>
<allowed-methods>shout,bins</allowed-methods>
</action>
<action name="shou" class="com.bin.action.BinAction">
<result name="bins">bins.jsp</result>
<result name="shout">shout.jsp</result>
</action>
</package>
</struts>
在struts2的2.5的版本后,必须要加入(shout,bins为方法名称)
通配符
shout,bins
动态方法调用
bins,shout
才能使用动态方法调用和通配符的使用
前台页面的调用链接:
通配符:
http://localhost:8080/xxx_war_exploded/bin_shout
http://localhost:8080/xxx_war_exploded/bin_bins
动态方法调用:
http://localhost:8080/xxx_war_exploded/bin!shout
http://localhost:8080/xxx_war_exploded/bin!bins
参考:https://www.jianshu.com/p/b6c961a1a141