Am new to spring and I know this question has been asked many times, but I had to ask it again.
I guess,I have done appropriate namespace declarations, but still facing the error "The prefix "context" for element "context:component-scan" is not bound."
There is a similar question here, but I dint get the answer
Here is my xml document, Is it that my namespace is not correct ?
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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/spring-context-3.0.xsd"> <bean id="point1" class="org.sri.proj.Point"> <property name="x" value="0" /> <property name="y" value="0" /> </bean> <bean id="point2" class="org.sri.proj.Point"> <property name="x" value="10" /> <property name="y" value="10" /> </bean> <context:component-scan base-package="org.sri.proj"/> </beans>
Add the context
namespace declaration to the beans
tag definition in the application context file
<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-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With