日期:2014-05-18 浏览次数:20758 次
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>webApp.bestAudit</param-value>
</context-param>
<!-- 指定Spring的配置文件 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/*Context.xml </param-value>
</context-param>
<!-- 指定以Listener方式启动Spring容器 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- 配置Struts 2.1的核心控制器StrutsPrepareAndExecuteFilter -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<mime-mapping>
<extension>xml</extension>
<mime-type>text/xml</mime-type>
</mime-mapping>
</web-app>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<!-- 设置Action的请求后缀为.action,防止Struts2.1将无后缀请求亦当成正常的Action请求处理 -->
<constant name="struts.action.extension" value="action"/>
<!-- 设置Web应用的默认编码集为gbk -->
<constant name="struts.i18n.encoding" value="utf-8"/>
<!-- 设置Web应用的默认Locale为zh_CN -->
<constant name="struts.locale" value="zh_CN" />
<!-- 设置Struts2.1应用的国际化资源文件,多个文件中间可用逗号分隔 -->
<constant name="struts.custom.i18n.resources" value="messageResource"/>
<!-- 设置Struts2.1默认的ObjectFactory为spring -->
<constant name="struts.objectFactory" value="spring" />