<? xml version = "1.0" encoding = "UTF-8" ?> |
< web-app xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" |
xmlns = "http://java.sun.com/xml/ns/javaee" |
xsi:schemaLocation = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" |
version = "2.5" > |
<!-- 配置spring初始化容器对象的监听器 --> |
< listener > |
< listener-class >org.springframework.web.context.ContextLoaderListener</ listener-class > |
</ listener > |
< context-param > |
< param-name >contextConfigLocation</ param-name > |
< param-value >classpath:applicationContext*.xml</ param-value > |
</ context-param > |
|
<!-- |
用于做初始化工作的监听器,一定要配置到Spring的ContextLoaderListener之后,因为要用到Spring的容器对象 |
--> |
< listener > |
< listener-class >cn.itcast.oa.util.InitListener</ listener-class > |
</ listener > |
|
< filter > |
< filter-name >OpenSessionInViewFilter</ filter-name > |
< filter-class >org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</ filter-class > |
</ filter > |
< filter-mapping > |
< filter-name >OpenSessionInViewFilter</ filter-name > |
< url-pattern >*.action</ url-pattern > |
</ filter-mapping > |
|
< 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 > |
</ web-app > |