zoukankan      html  css  js  c++  java
  • Spring配置文件笔记

    启动服务器:
        <!-- Spring ApplicationContext配置文件的路径,可使用通配符. -->
        <!-- 多个路径用,号分隔此参数用于后面的Spring Context Loader -->
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath*:/applicationContext.xml</param-value>
        </context-param>
        <!-- Spring初始化容器类. -->
        <!-- 取配置文件里面定义的参数contextConfigLocation-->
        <!-- 若没有定义参数,则默认读取applicationContext.xml. -->
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
    以上内容会初始化容器类,实例化所有交给Spring的类。
    
    用户请求过滤类:
       <!-- 字符编码过滤. -->
        <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>
            <init-param>
                <param-name>forceEncoding</param-name>
                <param-value>true</param-value>
            </init-param>
        </filter>
        <filter-mapping>
            <filter-name>encodingFilter</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>
    用户请求分发类: <!-- Spring分发的类,所有以.html结尾的页面均对应classpath*:dispatcher-servlet.xml配置文件. --> <servlet> <servlet-name>dispatcher-servlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:dispatcher-servlet.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>dispatcher-servlet</servlet-name> <url-pattern>*.html</url-pattern> </servlet-mapping> 其他辅助类: <!-- Spring 刷新Introspector防止内存泄露 --> <listener> <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class> </listener> <!-- spring Security获得session生存周期事件 --> <listener> <listener-class> org.springframework.security.web.session.HttpSessionEventPublisher </listener-class> </listener>

      

    路慢慢其休远羲,吾将上下而求所
  • 相关阅读:
    jq select 一些操作
    jq控制select值为某个时选中
    php loop循环 拿到键名
    php输出textarea数据(入库没有处理的)
    div下面多个a标签的点击事件,并且获取a的属性
    微信支付签名错误(第四点试过已得)
    微擎系统二维码关注回调(后台生成的二维码,可用于生成下线)
    微擎系统生成可以扫描关注的二维码,在后台二维码管理哪里有生成流程
    关于ContentProvider(二)
    关于ContentProvider(初识篇)
  • 原文地址:https://www.cnblogs.com/garinzhang/p/2690543.html
Copyright © 2011-2022 走看看