在web.xml中加载Spring容器
<listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:beans.xml</param-value> <!-- <param-value>classpath:applicationContext*.xml</param-value> --> </context-param>