Spring MVC - 没有声明可以找到
问题描述:
我完全是一个noob,我试图按照春季初学者指南。在调度程序servlet声明(名为DefaulServlet)中,我得到这个错误:cvc-complex-type.2.4.c:匹配通配符是严格的,但是对于元素上下文组件扫描没有发现声明。Spring MVC - 没有声明可以找到
在XML文件中的代码是
<?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:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.spingframework.org/schema/context"
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-4.3.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd">
<mvc:annotation-driven />
<context:component-scan base-package="com.packt.webstore" />
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
</beans>
该项目的Maven依赖是:
spring-webmvc-4.3.3.RELEASE
spring-aop-4.3.3.RELEASE
spring-beans-4.3.3.RELEASE
spring-context-4.3.3.RELEASE
spring-core-4.3.3.RELEASE
commons-logging-1.2
spring-expression-4.3.3.RELEASE
spring-web-4.3.3.RELEASE
jstl-1.2
javax.servlet-api-3.1.0
我真的被困在这里。请帮帮我。
答
+0
请** **您的文章,并显示实际的代码为文本,而不是截图。其他人不能从你的图像复制和粘贴。详细信息请参见此处(http://meta.*.com/a/285557/1402846)。请阅读[本帮助中心页面](http://*.com/editing-help)了解如何格式化您的代码。谢谢。 – Pang
hey here [匹配通配符是严格的,但没有声明可以找到元素的上下文:组件扫描](http://*.com/questions/13589470/the-matching-wildcard-is-strict-但是没有声明可以找到元素co) –