我正在尝试使用<context:component-scan base-package="">
和<context:annotation-config/>
。我的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"
xsi:schemaLocation="
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.3.xsd">
</beans>
但是必须为元素类型“ beans”声明eclipse抛出属性“ xmlns”和“ xmlns:aop”,“ xmlns:context”等。我怎样才能解决这个问题?预先感谢。
答案 0 :(得分:0)
添加Spring bean xsd schemaLocation
<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"
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">