标签:link www 优先级 延迟 patch 整数 nbsp 规范 include
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<filter>
<filter-name>openSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
《OpenSessionFilterView 针对Hibernate延迟加载》
<filter-mapping>
<filter-name>openSessionInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>
《
1、此监听器主要用于解决java.beans.Introspector导致的内存泄漏的问题
2、此监听器应该配置在web.xml中与Spring相关监听器中的第一个位置(也要在ContextLoaderListener的前面)
3、JDK中的java.beans.Introspector类的用途是发现Java类是否符合JavaBean规范如果有的框架或程序用到了Introspector类,那么就会启用一个系统级别的缓存,此缓存会
存放一些曾加载并分析过的JavaBean的引用。当Web服务器关闭时,由于此缓存中存放着这些JavaBean的引用,所以垃圾回收器无法回收Web容器中的JavaBean对象,最后导致
内存变大。而org.springframework.web.util.IntrospectorCleanupListener就是专门用来处理Introspector内存泄漏问题的辅助类。IntrospectorCleanupListener会在
Web服务器停止时清理Introspector缓存,使那些Javabean能被垃圾回收器正确回收。Spring自身不会出现这种问题,因为Spring在加载并分析完一个类之后会马上刷新
JavaBeans
Introspector缓存,这就保证Spring中不会出现这种内存泄漏的问题。但有些程序和框架在使用了JavaBeans
Introspector之后,没有进行清理工作(如 Quartz,Struts),最后导致内存泄漏
》
<!-- spring context -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:core-context.xml</param-value>
</context-param>
《core-context.xml spring配置 在xml配置了这个标签后,spring可以自动去扫描base-pack下面或者子包下面的java文件,如果扫描到有@Component @Controller@Service等这些注解的类,则把这些类注册为bean
注意:如果配置了<context:component-scan>那么<context:annotation-config/>标签就可以不用再xml中配置了,因为前者包含了后者。另外<context:component-scan>还提供了两个子标签
1. <context:include-filter>
2. <context:exclude-filter>
classpath:core-context.xml == 表示会在class文件夹下找
》
<context-param>
<param-name>typePackageName</param-name>
<param-value>com.ylink.cim.common.type</param-value>
</context-param>
<context-param>
<param-name>statePackageName</param-name>
<param-value>com.ylink.cim.common.state</param-value>
</context-param>
<context-param>
<param-name>showSingleSummary</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>htmlNavigator</param-name>
<param-value>flink.web.tag.ButtonHtmlNavigator</param-value>
</context-param>
<listener>
<description>listener for user session management</description>
<listener-class>com.ylink.cim.admin.view.CPSHttpSessionListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
《ContextLoaderListener监听器的作用就是启动Web容器时,自动装配ApplicationContext的配置信息。因为它实现了ServletContextListener这个接口,在web.xml配置这个监听器,启动容器时,就会默认执行它实现的方法。至于ApplicationContext.xml这个配置文件部署在哪,如何配置多个xml文件,书上都没怎么详细说明。现在的方法就是查看它的API文档。在ContextLoaderListener中关联了ContextLoader这个类,所以整个加载配置过程由ContextLoader来完成。看看它的API说明。》
<!-- log4j servlet -->
<servlet>
<servlet-name>log4jLoader</servlet-name>
<servlet-class>flink.web.Log4jServlet</servlet-class>
<init-param>
<param-name>log4j</param-name>
<param-value>/WEB-INF/classes/log4j.properties</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
《1)load-on-startup元素标记容器是否在启动的时候就加载这个servlet(实例化并调用其init()方法)。
2)它的值必须是一个整数,表示servlet应该被载入的顺序
2)当值为0或者大于0时,表示容器在应用启动时就加载并初始化这个servlet;
3)当值小于0或者没有指定时,则表示容器在该servlet被选择时才会去加载。
4)正数的值越小,该servlet的优先级越高,应用启动时就越先加载。
5)当值相同时,容器就会自己选择顺序来加载。
》
<!-- action servlet -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>
/WEB-INF/struts-config.xml,
/WEB-INF/struts-config-user.xml,
/WEB-INF/struts-config-admin.xml,
/WEB-INF/struts-config-custom.xml,
/WEB-INF/struts-config-invest.xml,
/WEB-INF/struts-config-busioper.xml
</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- 此应用的启动顺序必须在SystemContextServlet之后 -->
<servlet>
<servlet-name>AppServerServlet</servlet-name>
<servlet-class>com.ylink.cim.appserver.server.AppServerServlet</servlet-class>
<init-param>
<param-name>start</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<!-- system context servlet -->
<servlet>
<servlet-name>SystemContextServlet</servlet-name>
<servlet-class>flink.web.SystemContextServlet</servlet-class>
<init-param>
<param-name>serverType</param-name>
<param-value>admin</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- system context servlet -->
<servlet>
<servlet-name>timerServer</servlet-name>
<servlet-class>com.ylink.common.timer.TimerScheduleServer</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet>
<servlet-name>verifyCode</servlet-name>
<servlet-class>flink.VerifyCodeServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>verifyCode</servlet-name>
<url-pattern>/servlet/verifyCode</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>dispatchBranch</servlet-name>
<servlet-class>flink.web.DispatchBranchServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>dispatchBranch</servlet-name>
<url-pattern>/sz</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>dispatchBranch</servlet-name>
<url-pattern>/sz/</url-pattern>
</servlet-mapping>
<!-- <servlet-mapping> -->
<!-- <servlet-name>dispatchBranch</servlet-name> -->
<!-- <url-pattern>/dg</url-pattern> -->
<!-- </servlet-mapping> -->
<!-- <servlet-mapping> -->
<!-- <servlet-name>dispatchBranch</servlet-name> -->
<!-- <url-pattern>/dg/</url-pattern> -->
<!-- </servlet-mapping> -->
<!-- <servlet-mapping> -->
<!-- <servlet-name>dispatchBranch</servlet-name> -->
<!-- <url-pattern>/gz</url-pattern> -->
<!-- </servlet-mapping> -->
<!-- <servlet-mapping> -->
<!-- <servlet-name>dispatchBranch</servlet-name> -->
<!-- <url-pattern>/gz/</url-pattern> -->
<!-- </servlet-mapping> -->
<filter>
<filter-name>encoding</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>GBK</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encoding</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>encoding</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter>
<filter-name>privilege</filter-name>
<filter-class>com.ylink.cim.admin.view.PrivilegeFilter</filter-class>
</filter>
<!-- <filter> -->
<!-- <filter-name>userLogFilter</filter-name> -->
<!-- <filter-class>com.ylink.cim.admin.view.UserLogFilter</filter-class> -->
<!-- </filter> -->
<filter-mapping>
<filter-name>privilege</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>privilege</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<!-- <filter-mapping> -->
<!-- <filter-name>userLogFilter</filter-name> -->
<!-- <url-pattern>/*</url-pattern> -->
<!-- </filter-mapping> -->
<jsp-config>
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/flink.tld</taglib-uri>
<taglib-location>/WEB-INF/flink.tld</taglib-location>
</taglib>
</jsp-config>
<welcome-file-list>
<welcome-file>navi.jsp</welcome-file>
</welcome-file-list>
<error-page>
<error-code>404</error-code>
<location>/login.do?action=index</location>
</error-page>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<30分钟>
</web-app>
标签:link www 优先级 延迟 patch 整数 nbsp 规范 include
原文地址:http://www.cnblogs.com/hxhui/p/7462103.html