jeecms 2012 源码分析(7) web.xml分析
转载请标识出处 by chenbo:http://blog.csdn.net/chenbo19867758/article/details/12844251
<?xml version="1.0" encoding="UTF-8"?><web-app id="WebApp_ID" 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"><display-name>JeeCms2012</display-name><context-param><param-name>contextConfigLocation</param-name><param-value><!-- 数据库相关配置 -->/WEB-INF/config/application-context.xml<!-- 数据缓存相关配置 -->/WEB-INF/config/cache-context.xml<!-- 验证码相关配置 -->/WEB-INF/config/captcha-context.xml<!-- 图片,密码,文件上传等配置 -->/WEB-INF/config/jeecore-context.xml<!-- spring bean相关配置 -->/WEB-INF/config/jeecms-context.xml</param-value></context-param><filter><!-- 打印执行时间与访问路径过滤器 --><filter-name>processTime</filter-name><filter-class>com.jeecms.common.web.ProcessTimeFilter</filter-class></filter><filter><!-- 编码设置 --><filter-name>encoding</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><!-- 解决Hibernate session延迟加载的问题 --><filter-name>osivFilter</filter-name><filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class></filter><filter-mapping><filter-name>processTime</filter-name><url-pattern>*.do</url-pattern></filter-mapping><filter-mapping><filter-name>encoding</filter-name><url-pattern>*.do</url-pattern></filter-mapping><filter-mapping><filter-name>osivFilter</filter-name><url-pattern>*.do</url-pattern></filter-mapping><filter-mapping><filter-name>processTime</filter-name><url-pattern>*.jspx</url-pattern></filter-mapping><filter-mapping><filter-name>encoding</filter-name><url-pattern>*.jspx</url-pattern></filter-mapping><filter-mapping><filter-name>osivFilter</filter-name><url-pattern>*.jspx</url-pattern></filter-mapping><filter-mapping><filter-name>processTime</filter-name><url-pattern>*.jhtml</url-pattern></filter-mapping><filter-mapping><filter-name>encoding</filter-name><url-pattern>*.jhtml</url-pattern></filter-mapping><filter-mapping><filter-name>osivFilter</filter-name><url-pattern>*.jhtml</url-pattern></filter-mapping><filter-mapping><filter-name>processTime</filter-name><url-pattern>*.htm</url-pattern></filter-mapping><filter-mapping><filter-name>encoding</filter-name><url-pattern>*.htm</url-pattern></filter-mapping><filter-mapping><filter-name>osivFilter</filter-name><url-pattern>*.htm</url-pattern></filter-mapping><filter-mapping><filter-name>processTime</filter-name><url-pattern>*.jsp</url-pattern></filter-mapping><filter-mapping><filter-name>encoding</filter-name><url-pattern>*.jsp</url-pattern></filter-mapping><filter-mapping><filter-name>osivFilter</filter-name><url-pattern>*.jsp</url-pattern></filter-mapping><servlet><!--后台控制DispatcherServlet是前端控制器设计模式的实现,提供Spring Web MVC的集中访问点,而且负责职责的分派,而且与Spring IoC容器无缝集成,从而可以获得Spring的所有好处DispatcherServlet主要用作职责调度工作,本身主要用于控制流程,主要职责如下:1、文件上传解析,如果请求类型是multipart将通过MultipartResolver进行文件上传解析;2、通过HandlerMapping,将请求映射到处理器(返回一个HandlerExecutionChain,它包括一个处理器、多个HandlerInterceptor拦截器);3、通过HandlerAdapter支持多种类型的处理器(HandlerExecutionChain中的处理器);4、通过ViewResolver解析逻辑视图名到具体视图实现;5、本地化解析;6、渲染具体的视图等;7、如果执行过程中遇到异常将交给HandlerExceptionResolver来解析。 --><servlet-name>JeeCmsAdmin</servlet-name><servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class><init-param><param-name>contextConfigLocation</param-name><param-value>/WEB-INF/config/jeecms-servlet-admin.xml</param-value></init-param><load-on-startup>1</load-on-startup></servlet><servlet><!-- 前台控制 --><servlet-name>JeeCmsFront</servlet-name><servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class><init-param><param-name>contextConfigLocation</param-name><param-value>/WEB-INF/config/jeecms-servlet-front.xml</param-value></init-param><load-on-startup>2</load-on-startup></servlet><servlet><!-- 验证码图片 --><servlet-name>Jcaptcha</servlet-name><servlet-class>com.jeecms.common.captcha.JcaptchaServlet</servlet-class></servlet><servlet-mapping><servlet-name>Jcaptcha</servlet-name><url-pattern>/captcha.svl</url-pattern></servlet-mapping><servlet><!-- 暂时没看到,以后补上说明,数据库附件访问地址 --><servlet-name>DbFile</servlet-name><servlet-class>com.jeecms.core.action.front.DbFileServlet</servlet-class></servlet><servlet-mapping><servlet-name>JeeCmsAdmin</servlet-name><url-pattern>/jeeadmin/jeecms/*</url-pattern></servlet-mapping><servlet-mapping><servlet-name>JeeCmsFront</servlet-name><url-pattern>*.jhtml</url-pattern></servlet-mapping><servlet-mapping><servlet-name>JeeCmsFront</servlet-name><url-pattern>*.jspx</url-pattern></servlet-mapping><servlet-mapping><servlet-name>JeeCmsFront</servlet-name><url-pattern>*.jsp</url-pattern></servlet-mapping><servlet-mapping><servlet-name>JeeCmsFront</servlet-name><url-pattern>*.htm</url-pattern></servlet-mapping><servlet-mapping><servlet-name>DbFile</servlet-name><url-pattern>/dbfile.svl</url-pattern></servlet-mapping><listener><!-- ContextLoaderListener的作用就是启动Web容器时,自动装配ApplicationContext的配置信息。因为它实现了ServletContextListener这个接口,在web.xml配置这个监听器,启动容器时,就会默认执行它实现的方法。 --><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener><listener><!-- 它是一个在web应用关闭的时候,清除JavaBeans Introspector的监听器.在web.xml中注册这个listener.可以保证在web 应用关闭的时候释放与掉这个web 应用相关的class loader 和由它管理的类 防止内存泄露 --> <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class></listener><session-config><session-timeout>20</session-timeout></session-config><welcome-file-list><welcome-file>index.html</welcome-file><welcome-file>index.shtml</welcome-file><welcome-file>index.jhtml</welcome-file></welcome-file-list><error-page><error-code>403</error-code><location>/WEB-INF/error/403.html</location></error-page><error-page><error-code>404</error-code><location>/404.html</location></error-page><mime-mapping><extension>rar</extension><mime-type>application/zip</mime-type></mime-mapping><mime-mapping><extension>doc</extension><mime-type>application/zip</mime-type></mime-mapping><mime-mapping><extension>wps</extension><mime-type>application/zip</mime-type></mime-mapping><mime-mapping><extension>et</extension><mime-type>application/zip</mime-type></mime-mapping></web-app>
转载请标识出处 by chenbo:http://blog.csdn.net/chenbo19867758/article/details/12844251