struts2配置文件加载顺序
2015-10-16 22:24
447 查看
struts2配置文件加载顺序
struts2框架要能执行,必须先加载StrutsPrepareAndExecuteFilter.在StrutsPrepareAndExecuteFilter的
init方法中对Dispatcher进行了初始化.
在Dispatcher类中定义的
init方法内就描述了struts2配置文件加载的顺序
在开发中,后加载文件中的配置会将先加载文件中的配置覆盖。
init_DefaultProperties(); // [1] ———- org/apache/struts2/default.properties
init_TraditionalXmlConfigurations(); // [2] — struts-default.xml,struts-plugin.xml,struts.xml
init_LegacyStrutsProperties(); // [3] — 自定义struts.properties
init_CustomConfigurationProviders(); // [5] —– 自定义配置提供
init_FilterInitParameters() ; // [6] —– web.xml
init_AliasStandardObjects() ; // [7] —- Bean加载
1.default.properties文件
作用:定义了struts2框架中所有常量
位置: org/apache/struts2/default.properties
2.struts-default.xml
作用:配置了bean,interceptor,result等。
位置:在struts的core核心jar包.
struts-plugin.xml
它是struts2框架中所使用的插件的配置文件。
struts.xml
我们使struts2所使用的配置文件。
3.struts.properties
就是可以自定义常量。
4.web.xml
相关文章推荐
- 如何成为一名专家级的开发人员
- 插件管理框架 for Delphi(一)
- 使用CSS框架布局的缺点和优点小结
- 列举PHP的Yii 2框架的开发优势
- .NET微信公众号开发之公众号消息处理
- Windows窗体的.Net框架绘图技术实现方法
- 浅谈JavaScript 框架分类
- 轻量级javascript 框架Backbone使用指南
- javascript实现框架高度随内容改变的方法
- 使用nodejs开发cli项目实例
- JS刷新框架外页面七种实现代码
- 超赞的动手创建JavaScript框架的详细教程
- nodejs开发微博实例
- Egret引擎开发指南之创建项目
- 简单介绍不用库(框架)自己写ajax
- asp.net4.0框架下验证机制失效的原因及处理办法
- 插件管理框架 for Delphi(二)
- Android开发自学笔记(二):工程文件剖析
- 零基础学习AJAX之AJAX框架
- Ajax 框架学习笔记