配置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