struts.xml的通配符配置(wildcard)
<struts2.xml> <action name="Student*" method="{1}"> <result>/WEB-INF/jsp/Student{1}_success.jsp</result> </action> <!-- http://localhost:8088/struts04/actions/Teacher_add --> <action name="*_*" 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>