使用通配符前:
<action name="hello" class="cn.lfsenior.Hello.HelloStruts2" method="login">
<result name="login">/success.jsp</result>
</action>
<action name="hello" class="cn.lfsenior.Hello.HelloStruts2" method="register">
<result name="register">/register.jsp</result>
</action>
使用通配符后:
<!-- http://localhost:8080/struts02/user_login -->//星号表示的就是login
<action name="user_*" class="cn.itcast.a_config.UserAction" method="{1}">
<result name="{1}">/{1}.jsp</result>
</action>
使用通配符可以简化代码,使其变得更加灵活
当有两个*时,后面需要用{1},{2}分别来表示*