Struts2的6个配置文件,分别是struts-default.xml,default.properties,struts-plugin.xml,struts.xml,struts.properties,web.xml
1、struts-default.xml,里面放置的是struts2框架的核心东西,如bean类,package包,result type,interceptor拦截器等
2、default.properties,properties类型的文件里面放置的是键值对,key和value,主要是对一些常量进行设定。
3、struts-plugin.xml,与第三方插件进行整合时需要使用的配置文件。如我们和spring进行整合时,就需要使用到struts-spring-plugin.xml这个配置文件
4、struts.xml,需要我们程序员在src目录下手动创建,在这个里面也可以对常量进行设定,使用的是constant标签,包含name和value属性。
5、struts.properties,这里也是对常量进行设定
6、web.xml,这里设定struts2的启动项,使用的是filter和filter-mapping标签,也可以进行常量的设定,在filter标签里使用init-param标签。但是我们一般不再这里设定。
这里有4个配置文件,可以对常量进行设定。分别是default.properties,struts.xml,struts.properties,web.xml。他们的优先级顺序是web.xml优先级最高,其次是struts.properties,struts.xml,最后是default.properties。我们最主要进行学习的就是struts.xml,其他的作为了解内容就可以了。