zoukankan      html  css  js  c++  java
  • 控制器里无法使用@Controller和@RequestMapping等注释

    我以为springframework的版本越高越好,所以我在POM里的版本号写了5.0.4.RELEASE,然后就导致没法使用@Controller和@RequestMapping等注释;

    其实,只要改成4.3.14.RELEASE就可以了.

    为什么会这样呢?

    DispatcherServlet根据原则读取XML配置文件里的定义是这样的:

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

    是不是跟这里的xsd版本有关?

  • 相关阅读:
    vue自定义指令directive
    vue组件:input数字输入框
    vue中用数组语法绑定class
    vue中检测数组改变
    node绝对和相对模块
    判断拖放
    媒体查询 和rem布局
    JSON字符串对象相互转换
    深度封装typeof判断
    类数组
  • 原文地址:https://www.cnblogs.com/tomato2014/p/8503932.html
Copyright © 2011-2022 走看看