zoukankan      html  css  js  c++  java
  • spring: 一些基本配置也许只有自己能够读懂

    web.xml
    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/daoContext.xml /WEB-INF/applicationContext.xml</param-value>
    </context-param>

    <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <!-- or use the ContextLoaderServlet instead of the above listener
    <servlet>
    <servlet-name>context</servlet-name>
    <servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    -->

    监听器首先检查contextConfigLocation参数,如果它不存在,它将使用/WEB-INF/applicationContext.xml作为默认值。如果已存在,它将使用分隔符(逗号、冒号或空格)将字符串分解成应用上下文件位置路径。可以支持ant-风格的路径模式,如/WEB-INF/*Context.xml(WEB-INF文件夹下所有以"Context.xml"结尾的文件)。或者/WEB-INF/**/*Context.xml(WEB-INF文件夹及子文件夹下的以"Context.xml"结尾的文件)。

    ContextLoaderServletContextLoaderListener一样使用'contextConfigLocation'参数。

    Resource strings

    前缀例子说明

    classpath:

    classpath:com/myapp/config.xml

    从classpath中加载。

    file:

    file:/data/config.xml

    作为 URL 从文件系统中加载。

    http:

    http://myserver/logo.png

    作为 URL 加载。

    (none)

    /data/config.xml

    根据 ApplicationContext 进行判断。

    forward.molly.宝儿 独自行走
  • 相关阅读:
    C#之获取本地IP地址
    C#中对Excel进行操作
    C#中的TCP通讯与UDP通讯
    Flex 学习
    正则表达式实例
    sass调试--页面看到sass文件而不是css文件问题
    webpack+vue-loader 在单独.vue组件中使用sass-loader编译sass报错问题not a valid Win32 applictation
    SVG图案填充-Pattern
    jQuery小技巧
    代码整洁一
  • 原文地址:https://www.cnblogs.com/forward/p/1820397.html
Copyright © 2011-2022 走看看