<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:beans.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframword.web.context.ContextLoaderListener</listener-class>
</listener>
我想在所有用到spring框架的时候上面的2个配置肯定会出现在web.xml中的,而且一般就在配置文件的最上端,它的含义就是获取到spring容器,监听是得到spring容器并读取<context-param>中配置文件的内容。其中classpath就是src源文件下,也就是class文件下,classpath是spring提供的一个变量。如果不写classpath,系统默认是从web根目录下找