Struts2中的通配符和常量的说明

1、简单介绍下Struts2中的通配符的使用

<package name="default" namespace="/" extends="struts-default">
		<action name="*_*" class="com.wen.action.{1}Action" method="{2}">
			<result>/WEB-INF/{1}/{2}.jsp</result>
		</action>
    </package>

解释下:①*_*表示访问时候的action访问的方法;例如User_add表示访问UserAction中的add方法;②:/WEB-INF/{1}/{2}.jsp中{1}表示User文件夹;{2}表示add.jsp;

2、struts.xml中的静态一些常量的配置;

struts2中的常量文件其实一个propertes文件;/org/apache/struts2/default.properties

3、多少struts.xml文件的引入;

例如:<include file="example.xml"/>

你可能感兴趣的:(Struts2中的通配符和常量的说明)