Optional long parameter ‘busId‘ is present but cannot be translated into a null value
今天写一个接口的时候报了下面的错误,接口如下:
@RequestMapping(value = "/isSignOuted", method = RequestMethod.GET)
public String isSignOuted(long busId){
}
Optional long parameter 'busId' is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.
这是因为这个参数如果是非必须的话,如果前端没有传参数过来的话,会先将参数赋值为null,但是你如果用基本数据类型long的话,它是接收不了null的,所以它建议你将参数的类型声明为包装类型Long,才可以接收null。
Optional long parameter ‘busId‘ is present but cannot be translated into a null value相关推荐
- Optional int parameter ‘xxx‘ is present but cannot be translated into a null value due to being decl
错误描述: processing failed; nested exception is java.lang.IllegalStateException: Optional int parameter ...
- Optional int parameter 'page' is present but cannot be translated into a null value due to being dec
这个错误犯两回了 int改integer 原始类型不能为null 包装类可以 我的spring mvc 代码: @Controller @RequestMapping("/product&q ...
- Optional int parameter 'id' is present but cannot be translated into a null value due to being
执行## ........(int id);报出以下错误. Optional int parameter 'id' is present but cannot be translated into a ...
- Optional int parameter ‘page‘ is present but cannot be translated into a null value due to being dec
背景:在测试上面这个controller时(status为查询条件Limit,查询status为1/0的所有记录),当用postman发出请求http://localhost:8080/orders/ ...
- Optional int parameter ‘xxx‘ is present but cannot be translated into a null value due to being.....
异常代码 `j`ava.lang.IllegalStateException: Optional int parameter 'tyId' is present but cannot be trans ...
- Optional int parameter ‘id‘ is present but cannot be translated into a null value
接收参数时遇到的问题 开始的代码 @RequestMapping("/deleteComment")@ResponseBodypublic ResultInfo deleteCom ...
- Optional int parameter ‘xxx‘ is present but cannot be translated into a null value due to being
Optional int parameter 'domainId' is present but cannot be translated into a null value due to being ...
- Optional int parameter ‘grade‘ is present but cannot be translated into a null value due to being de
完整的错误提示信息: 复制出来看的清楚些: Optional int parameter 'grade' is present but cannot be translated into a null ...
- Optional int parameter ‘categoryId‘ is present but cannot be translated into a null value due to be
Optional int parameter 'categoryId' is present but cannot be translated into a null value due to bei ...
最新文章
- 第八章 泛型程序设计
- BESR备份还原SERVER 2003域控制器
- css你所不知道技巧
- Java的面试汇总,有这些还担心不通过?
- Java虚拟机运行时数据区
- PHP 中数组获取不到元素
- BFS和DFS的java实现
- 2017-2018-2 20165314 实验三《 敏捷开发与XP实践》实验报告
- delphi7连接oracle,delphi7.0连接oracle数据库的.doc
- ttc文件linux安装,Linux当中如何安装字体?
- Windows解压tar.gzip文件
- 关于本地磁盘“介质受写入保护”的解决
- python解析库 爬虫_Python-爬虫-解析库(Beautiful Soup)的使用
- 操作系统第2章作业题答案
- sqlserver数据库18456错误怎么解决?
- CS231n系列之 Lecture1:Introduction
- 英语论文格式有什么要求?
- iOS 【模仿App 获取app素材】
- 解释#define的用法
- Unity3D使用Animation编辑器编辑动画