在web.xml中如何加载aplicationContext.xml文件

来源:互联网 发布:淘宝网店没上货被收回 编辑:程序博客网 时间:2024/06/05 09:58

web.xml的写法

<?xml version="1.0" encoding="UTF-8"?><web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"    version="2.5">    <display-name>demo-web</display-name>        <!-- Spring ApplicationContext配置文件的路径,可使用通配符,多个路径用,号分隔        此参数用于后面的Spring Context Loader -->    <context-param>        <param-name>contextConfigLocation</param-name>        <param-value>            classpath*:/applicationContext.xml            classpath*:/applicationContext-shiro.xml        </param-value>    </context-param>    <!--Spring的ApplicationContext 载入 -->    <listener>        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>    </listener></web-app>




原创粉丝点击