您的位置:首页 > 编程语言 > Java开发

The prefix "context" for element "context:component-scan" is not bound.

2015-01-16 16:29 441 查看
配置spring,配置

<context:component-scan base-package="包名" />

时,报错:

The prefix "context" for element "context:component-scan" is not bound.

是因为该配置文件的<beans></beans>标签的属性少了东西。<beans>加上相应属性即可。如下图(红线上那一列即为需要加上的东西):



下面是需要添加的部分的文字版:

xmlns:context="http://www.springframework.org/schema/context"
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  spring
相关文章推荐