在web.xml中添加如下代码
1 <context-param> 2 <param-name>contextConfigLocation</param-name> 3 <param-value>classpath*:*.xml</param-value> 4 </context-param> 5 6 <listener> 7 <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> 8 </listener>