分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 软件开发

The prefix "mvc" for element "mvc:annotation-driven" is not bound 异常

发布时间:2023-09-06 01:11责任编辑:郭大石关键词:element

使用STS或者eclipse 开发SpringMVC应用 时,我靠。。有个小小的东西没注意搞了半天,

STS在创建SpringMVC工程时,自动生成了Dispatcher的配置文件,然后看教程时,使用了<mvc:annotation-driven> 注解配置

但是自动生成的xml里呢有一个<annotation-driven>, 挺疑惑的,以为mvc约束文件版本不对,所以配置了很久的本地约束,仍然没有用

后来决定仔细看看什么问题,通过代码排版对齐,发现了。。。。。靠,前缀也是需要配置的!!改成下面所示代码。OK了

注意蓝色的是以前的,改成红色的,就多了个  :mvc

The prefix "mvc" for element "mvc:annotation-driven" is not bound异常

<?xml version="1.0" encoding="UTF-8"?>

<beans:beans

    xmlns= "http://www.springframework.org/schema/mvc"

    xmlns:mvc="http://www.springframework.org/schema/mvc"

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    xmlns:beans="http://www.springframework.org/schema/beans"

    xmlns:context="http://www.springframework.org/schema/context"

    xsi:schemaLocation="

        http://www.springframework.org/schema/mvc

        http://www.springframework.org/schema/mvc/spring-mvc.xsd

        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">

   

    <mvc:annotation-driven />

    <mvc:resources location="/resources/" mapping="/resources/**"/>

       

</beans:beans>

 

The prefix "mvc" for element "mvc:annotation-driven" is not bound 异常

原文地址:http://www.cnblogs.com/maodot/p/7531042.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved