<?xml version="1.0" encoding="UTF-8"?>
<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"
xmlns:mvc="http://www.springframework.org/schema/mvc"
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
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
<ctx:annotation-config></ctx:annotation-config>
<ctx:component-scan base-package="com.wipro"></ctx:component-scan>
</beans>
我在ctx:annotation-config行中出错,因为元素“ ctx:annotation-config”的前缀“ ctx”没有绑定。我是新手,请帮帮我。
答案 0 :(得分:1)
请在下面添加一行
xmlns:ctx="http://www.springframework.org/schema/context"
答案 1 :(得分:0)
我在您的XML配置中看到的上下文是 xmlns:context =“ http://www.springframework.org/schema/context”
因此,您应该使用context:annotation-config。