javaweb三層架構和mvc架構,SpringMVC 搭建遇到的坑

 2023-11-19 阅读 27 评论 0

摘要:1. Caused by: org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 60; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:component-scan'. 多半是配置文件缺少鏈接找不到資源引起的,或是

1. Caused by: org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 60; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:component-scan'.

多半是配置文件缺少鏈接找不到資源引起的,或是springmvc 版本和xsd版本不一致引起的.

idea新建的springMvc 工程,參考 https://blog.csdn.net/love_java_cc/article/details/76359815#commentBox

javaweb三層架構和mvc架構、生成的配置文件,有

xmlns:context="http://www.springframework.org/schema/context"
我在下文中增加了
<context:component-scan base-package="com.spring.mvc"/>
就出錯了,還需要還需要添加 URL
在dispatchcher-sevlet.xml 中增加
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
就能運行成功.

轉載于:https://www.cnblogs.com/changlili/p/10117269.html

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/1/179336.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息