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版本有关?

  • 相关阅读:
    这是另外一篇
    使用客户端写博客
    vim编码相关配置
    给eclipse装一些插件
    手机型号收集
    解决黑苹果与windows时区不一致
    记录一些在VPS上折腾的东西
    一个获取文件绝对路径的sh
    python批量GBK转UTF-8
    用NDK编译lua库
  • 原文地址:https://www.cnblogs.com/tomato2014/p/8503932.html
Copyright © 2011-2022 走看看