class="java">
<struts2.xml>
<action name="Student*" class="action.StudentAction" method="{1}">
<result>/WEB-INF/jsp/Student{1}_success.jsp</result>
</action>
<!-- http://localhost:8088/struts04/actions/Teacher_add -->
<action name="*_*" class="action.{1}Action" method="{2}">
<result>/WEB-INF/jsp/{1}_{2}_success.jsp</result>
<!-- {0}_success.jsp -->
</action>
<index页面>
<body>
使用通配符,将配置量降到最低
[url=<%=context %>/actions/Studentadd]添加学生[/url]
[url=<%=context %>/actions/Studentdelete]删除学生[/url]
不过,一定要遵守"约定优于配置"的原则
[url=<%=context %>/actions/Teacher_add]添加老师[/url]
[url=<%=context %>/actions/Teacher_delete]删除老师[/url]
</body>
<Action命名>
<jsp页面命名>