zoukankan      html  css  js  c++  java
  • The prefix "mvc" for element "mvc:annotationdriven" is not bound 异常

    使用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>

     

  • 相关阅读:
    为初学者解释下命名空间
    面向对象的思想
    SELECT查询结果集INSERT到数据表
    SQL Server事务
    Sql Server中的谓词和运算符
    SQL查询语句执行的逻辑顺序
    浏览器中的流
    CSS盒子模型
    ArcGIS提取水系并进行生态敏感性分析
    ENVI提取水系并进行生态敏感性分析
  • 原文地址:https://www.cnblogs.com/maodot/p/7531042.html
Copyright © 2011-2022 走看看