您的位置:首页 > 其它

classpath

2015-06-10 08:35 295 查看
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0"
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_3_0.xsd"> <!--  -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:resources/applicationContext.xml</param-value>
</context-param>

<servlet>
<servlet-name>chapter02</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:resources/abc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>chapter02</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
这里的
<param-value>classpath:resources/applicationContext.xml</param-value>

classpath指的是src下的文件,而

<param-value>applicationContext.xml</param-value>
它会去找webroot下的文件
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: