zoukankan      html  css  js  c++  java
  • 关于Spring MVC中的406错误

    关于Spring MVC中的406错误

    406错误表示响应的内容无法被识别!在使用Spring MVC时,如果出现406,可能是因为:

    1. spring-mvc.xml中没有添加  <mvc:annotation-driven /> 

    2. 使用了Jackson,但是没有添加完整的依赖,或Jar包出错,需要重新导入Jar包(删除.m2文件夹并重新更新Maven)

    补充:有时候可能添加了<mvc:annotation-driven />后,在XML中会提示xxxxxx.spring-mvc-3.2.xsd代码错误,此时,3.2修改为3.0即可

    <!-- Jackson所需jar包 -->
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.8.8</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
      <version>2.8.8</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
      <version>2.8.8</version>
    </dependency>

  • 相关阅读:
    常用模块
    二分查找算法
    递归函数
    文件操作
    day02--Python基础二(基础数据类型)
    Python学习笔记day01--Python基础
    Python2X和Python3X的区别
    testdisk修复文件系统
    机器学习入门 快速版
    tableau教程 快速入门
  • 原文地址:https://www.cnblogs.com/chenglaoshi/p/11630240.html
Copyright © 2011-2022 走看看