为什么我在项目启动时找不到所请求的资源,即使一切似乎都没问题
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:log4j.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
请帮助我!!!
答案 0 :(得分:0)
您需要使用org.springframework.web.context.ContextLoaderListener加载Spring上下文,而不是Log4jConfigListener(或尝试Spring Boot)