1主要配置文件
1.Actiond的struts.xml,用来管理Action的映射,放在src目录下的resources中。不然运行会报错,名字不要用struts2.xml,不然也会报错。
2.struts.properties,放在WEB-INF/classes路径下,定义了struts2框架的大量属性。如configuration
struts.xml
.... <action name=“login” class="com...."> |
<result name="success">success.jsp</result>---配置结果 |
</action> ........... |
Struts2框架按以下的顺序加载配置
1.struts-default.xml--struts2-2.0,6.jar
2,struts-plugin.xml--struts2.xxx-2.0.6.jar
3struts.xml--web应用默认struts2的配置文件
4.struts.properties--web应用默认的struts2的配置文件
5.web.xml--web应用配置文件