加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

xml – 元素“上下文:组件扫描”的前缀“上下文”未绑定

发布时间:2020-12-16 08:00:35 所属栏目:百科 来源:网络整理
导读:我正在使用spring3 mvc,并提出了这个错误 org.xml.sax.SAXParseException:元素“上下文:组件扫描”的前缀“上下文”未绑定。 这是我的调度程序servlet ?xml version="1.0" encoding="UTF-8"?beans xmlns="http://www.springframework.org/schema/beans" x
我正在使用spring3 mvc,并提出了这个错误

org.xml.sax.SAXParseException:元素“上下文:组件扫描”的前缀“上下文”未绑定。

这是我的调度程序servlet

<?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:p="http://www.springframework.org/schema/p"
    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-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">

    <mvc:annotation-driven />

    <context:component-scan base-package="com.web" />
当您缺少xmlns:context声明但您已声明它时,会出现此类错误。在“com.web”包中检查你的类是否有任何错误的编码。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读