Springboot 406错误
Springboot 406错误
简单的写了一个接口,然后406了。。。。
public class TestController {@GetMapping("/testGet/{message}")public Result testGet(@PathVariable String message){return Result.success(message);}
}
Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
怀疑版本问题,将2.5更换为2.3.2,错误变成
Resolved [org.springframework.http.converter.HttpMessageNotWritableException: No converter found for return value of type: class com.huakai.entity.Result]
问题的解决
在Result中添加@Data注解,添加了Get/Set方法,估计是jackson将对象转化为Json的时候需要GS。。。。
Springboot 406错误相关推荐
- SpringBoot之错误处理机制
文章目录 1.SpringBoot默认的错误处理机制 2.错误处理原理 (1)DefaultErrorAttributes (2)BasicErrorController:处理默认的/error请求 ...
- 大数据互联网架构阶段 Spring框架导致的406错误
Spring框架导致的406错误 一. 分析 当ajax发出请求(http://zxx.xxx.com/xxx.html后缀)实际是请求动态资源时 , .html后缀会让spring以为传递过来的请求 ...
- Spring 3.2.* MVC通过Ajax获取JSON数据报406错误
Spring 3.2.x通过@ResponseBody标签返回JSON数据的方法都报406错: Failed to load resource: the server responded with a ...
- http请求出现406错误解决方案
http请求出现406错误解决方案 参考文章: (1)http请求出现406错误解决方案 (2)https://www.cnblogs.com/tubeWang/p/10029008.html 备忘一 ...
- springboot系列六、springboot配置错误页面及全局异常
springboot系列六.springboot配置错误页面及全局异常 参考文章: (1)springboot系列六.springboot配置错误页面及全局异常 (2)https://www.cnbl ...
- springBoot启动错误:Field categoryMapper in xxx.xxx.service.impl.CategoryServiceImpl required a bean of
springBoot启动错误:Field categoryMapper in com.leyou.service.impl.CategoryServiceImpl required a bean of ...
- 406错误 java
java变异是出现406错误时,注解responsebody访问html页面会拦截出错,去掉html后缀就行了
- java406错误怎么解决_Spring MVC Rest服务 返回json报406错误的解决办法
@ResponseBody & @RequestBody @RequestBody 将 HTTP 请求正文插入方法中,使用适合的HttpMessageConverter将请求体写入某个对象. ...
- postman 返回json乱码_POSTMAN发起请求收到乱码 http 406错误
web前段异常: The resource identified by this request is only capable of generating responses with charac ...
- SpringBoot 配置错误页
错误页绝对是所有的 WEB 项目之中必须具有的一项信息显示处理,但是在传统的 WEB 项目开发过程之中, 错误页都是在 web.xml 文件之中进行配置的,不过遗憾的是 SpringBoot 之中并不 ...
最新文章
- asp.net mvc view中支持多个实体强类型小技巧
- 六、CPU优化(4)NUMA架构
- 四级计算机网络考试大纲,2017年全国计算机等级考试四级计算机网络考试大纲...
- 实习技术员的基本功(四)
- JQuery学习笔记12——GET请求和POST请求
- {转}maven+continuum安装与配置
- 各个版本spring的jar包以及源码下载地址
- yum配置中driver-class-name: com.mysql.jdbc.Driver报错
- 嵌入式linux添加环境变量,Linux环境变量
- 多线程销售问题java_Java多线程Runable售票系统实现过程解析
- 博弈——巴什博弈(hdu1846,2188,2897)
- 快捷键关机电脑_技巧 | 如何知道电脑多久没关机?一个命令就行嘞!
- 改变世界的iPhone背后都有些什么?
- GDALSetProjection使用的一个注意事项
- 石头扫地机器人音量怎么调_石头的新扫地机器人 T6,内外都有升级
- lora 调制解调器计算器_如何将Android手机用作调制解调器; 无需生根
- 深圳小汽车车牌竞拍价格预测
- iApp特殊篇-自定义app图标
- 将笔记本外接显示器设置为主显示器
- .net 大型药品进销存管理系统源码