today configuration is complete:
<!--automatic scanning and assembly, including sub-package--><context:component-scan base-package= "Cn.itcast.oa" ></context:component-scan >
after this sentence, validating my spring configuration file will never go down. Thought it was MyEclipse card, then removed all the validating.
Later, when I wrote a unit test to test spring configuration, I found an error:
columnnumber:54; the prefix "context" of the element "Context:component-scan" is unbound.
It seems that there is a problem with automatic assembly and scanning. Looked down, seems to be less the context of the namespace problem:
<beans xmlns= "Http://www.springframework.org/schema/beans"
xmlns:context= "Http://www.springframework.org/schema/context"
Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" xmlns:tx= "Http://www.springframework.org/schema/tx"
Xsi:schemalocation= "
Http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
Http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
Http://www.springframework.org/schema/context
Http://www.springframework.org/schema/context/spring-context-2.5.xsd
">
Add the part with the red font, and the successful run passed.
By the way, the various versions of XML, if not, will automatically use the latest version.
Spring configuration problem--the prefix "context" of the element "Context:component-scan" is unbound