Struts2 Web.XML
来源:互联网 发布:修改hosts文件软件 编辑:程序博客网 时间:2024/06/04 19:28
The web.xml web application descriptor(描述) file represents the core of the Java web application, so it is appropriate that it is also part of the core of the Struts framework. In the web.xml file, Struts defines its FilterDispatcher(控制器), the Servlet Filter class that initializes(初始化) the Struts framework and handles all requests(处理所有的请求). This filter can contain initialization parameters that affect what, if any,additional(额外增加的) configuration files are loaded and how the framework should behave.
In addition to(除..之外) the FilterDispatcher, Struts also provides an ActionContextCleanUp class that handles special cleanup tasks(处理特殊的清理工作) when other filters, such as those used by Sitemesh, need access to an initialized Struts framework.
Key Initialization Parameters
- config - a comma-delimited list(逗号分割的列表) of XML configuration files to load.
- actionPackages - a comma-delimited list of Java packages to scan(扫描) for Actions.
- configProviders - a comma-delimited list of Java classes that implement the ConfigurationProvider interface that should be used for building the Configuration.
- loggerFactory - The class name of the LoggerFactory implementation.
- * - any other parameters are treated as framework constants.
In the example above we've mapped the Struts 2 dispatcher to /*, so Struts 2 has a crack(入口,裂缝) at all incoming(传入,进来) requests. This is because Struts 2 serves static content from its jar files, including Dojo JavaScript files (if using S2.0, or the Dojoplugin(插件) in S2.1+) and FreeMarkertemplates(模板) for the Struts 2 tags that produce HTML.
If we change the filter mapping to something else(别的东西), for example /*.html, we must take this in to account and extract the(提取) content that would normally be served from the Struts 2 jar files, or some other solution.
Since Struts 2.1.7, you are able to provide a comma seperated(分离) list of patterns for which when matching against the
request URL the Filter will just pass by. This is done via(通过) the configuration option struts.action.excludePattern, for example in your struts.xml
<struts> <constant name="struts.action.excludePattern" value=".*unfiltered.*,.*\\.nofilter"/> ...</struts>
- Struts2 web.xml配置
- Struts2 web.xml 解析
- Struts2 配置 web.xml
- Struts2配置web.xml
- Struts2 Web.XML
- struts2 web.xml配置
- Struts2配置web.xml
- Struts2.0配置文件(web.xml)
- Struts2的web.xml配置
- struts2 web.xml 基础配置
- struts2 配置web.xml问题
- [Struts2]配置 web.xml文件
- Struts2.0配置文件(web.xml)
- Struts2.0配置文件(web.xml) .
- 配置Struts2 web.xml文件
- Struts2的web.xml配置
- struts2配置web.xml文件
- Struts2.0配置文件(web.xml)
- (莱昂氏unix源代码分析导读-12)系统初启(5)
- SQL语句实现SQL Server及ACCESS复制表结构或表结构及内容到新的表
- Python time模块
- android联系人多选
- 驱动程序的入口函数
- Struts2 Web.XML
- document.getElementsByName(name)该方法与 getElementById()用法
- HelloWorld版的驱动程序
- iframe可编辑
- 矩阵加法的CUDA实现
- Linux用户态和内核态之间的交互
- CodeSmith Module层 模板
- excel在QTP中实现自动化
- gdb调试C++ STL