我使用 IntelliJ IDEA 创建了一个 Spring Mvc 应用程序,然后我将默认应用程序配置文件移动并重命名到另一个目录。现在我收到此错误:“未为此文件配置应用程序上下文”文件的新位置是 src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml
该文件是这个:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- Enables the Spring MVC @Controller programming model -->
<mvc:annotation-driven/>
<mvc:resources mapping="/resources/**" location="/"/>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/pages/"/>
<property name="suffix" value=".jspx"/>
</bean>
<context:component-scan base-package="com.apress.prospring3.ch17.web.controller"/>
</beans>
有任何想法吗?谢谢你。