前端系统-备忘1

Posted on 2008-12-08 11:18 Robert Su 阅读(224) 评论(0)  编辑  收藏 所属分类: Java

 

<?xml version="1.0" encoding="UTF-8"?>
<web-app>
 <display-name>系统</display-name>
 <context-param>
  <param-name>log4jConfigLocation</param-name>
  <param-value>/WEB-INF/log4j.properties</param-value>
 </context-param>
 <!-- ContextConfigLocation -->
 <context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>/WEB-INF/vbm_action.xml,/WEB-INF/vbm_hibernate.xml,/WEB-INF/vbm_dao.xml</param-value>
 </context-param>

 <!-- 著名 Character Encoding filter -->

 <filter>
  <filter-name>encodingFilter</filter-name>
  <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
  <init-param>
   <param-name>encoding</param-name>
   <param-value>UTF-8</param-value>
  </init-param>
 </filter>
 <filter>
  <filter-name>struts2</filter-name>
  <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
  <init-param>
   <param-name>config</param-name>
   <param-value>struts-default.xml,struts-plugin.xml,struts.xml,struts_books.xml</param-value>
  </init-param>
 </filter>

 <filter-mapping>
  <filter-name>encodingFilter</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping>
 <filter-mapping>
  <filter-name>struts2</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping>
 <!-- 加入jpaFilter,是为了不让hibernate的session过早关闭,因为有的action会通过ajax动态调用 -->
 <filter>
  <filter-name>jpaFilter</filter-name>
  <filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class>
  <init-param>
   <param-name>entityManagerFactory</param-name>
   <param-value>entityManagerFactory</param-value>
  </init-param>
 </filter>
 <filter-mapping>
  <filter-name>jpaFilter</filter-name>
  <url-pattern>*.htm</url-pattern>
 </filter-mapping>
 <!-- Listener contextConfigLocation -->
 <listener>
  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
 </listener>
 <!-- Listener log4jConfigLocation -->
 <listener>
  <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
 </listener>
 <!-- Spring 刷新Introspector防止内存泄露 -->
 <listener>
  <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
 </listener>
 <!-- session超时定义,单位为分钟 -->
 <session-config>
  <session-timeout>10</session-timeout>
 </session-config>
 <!-- The Welcome File List -->
 <welcome-file-list>
  <welcome-file>index.html</welcome-file>
 </welcome-file-list>
</web-app>


只有注册用户登录后才能发表评论。


网站导航:
 

posts - 103, comments - 104, trackbacks - 0, articles - 5

Copyright © Robert Su