显示错误为:
Multiple annotations found at this line: - Cannot locate BeanDefinitionParser for element [resources] - Configuration problem: Cannot locate BeanDefinitionParser for element [resources] Offending resource: file
我正在使用spring 3.0.1和hibernate4。即使尝试过其他版本的spring,但仍然显示相同的内容。
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:security="http://www.springframework.org/schema/security"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/tool
http://www.springframework.org/schema/tool/spring-tool-3.0.xsd
http://www.springframework.org/schema/mvc
https://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<context:component-scan
base-package="Model,Controller,Dto,Service,Dao" />
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
id="jspViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView"></property>
<property name="prefix" value="/WEB-INF/jsp/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/**"/>
<bean id="localeChangeInterceptor"
class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="locale" />
</bean>
</mvc:interceptor>
</mvc:interceptors>
<mvc:annotation-driven></mvc:annotation-driven>
<mvc:resources location="/resources/" mapping="/resources/**" />
</beans>
我的spring-servlet代码如下图所示
在此处附加了代码
附带的代码请看一下,并尝试帮助解决我在Spring 4中尝试过的问题,并且显示相同的内容