新的解决方法Optional int parameter ‘xxx_id‘ is present but cannot be translated int
这个解决方法之所以新,在于情况比较特殊
我是用ssm框架,关于这个问题,我报错的原因不在于前端传到后端的值是null的情况,而是在控制器方法之间跳转时没有传参导致的,就是我写了redirect:"到另一个方法的RequestMapping";,但没注意要跳转到的方法里需要传int型参数。
而最为致命的是,运行出现错误的当前控制器的方法里也有一个同名的int参数,导致报错时,我一直以为是前端传到后端这个过程报错,却没考虑后端之间跳转出现错误。
如上图所示,下面这个方法运行完以后直接重定向到上面那个方法,而我一直在下面这个方法的参数列表里寻找原因,所以一直找不到原因。
希望该问题有参考意义,节省大家的时间。
解决该问题以后,
因为我之前写重定向就是为了不用再查一次,直接用已有的实现查询功能的方法,修正这个问题就老老实实再查一次就完了。
新的解决方法Optional int parameter ‘xxx_id‘ is present but cannot be translated int相关推荐
- 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 ‘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 ‘id‘ is present but cannot be translated into a null
问题: 报错Optional int parameter 'id' is present but cannot be translated into a null @RestController pu ...
- 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 ‘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 ...
- 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 ...
最新文章
- 表变量是什么_为什么要使用二级指针?
- 网易内推java 面试_网易内推面试
- 启明云端分享|LVGL官方认证的开发板,到底有多牛
- Apache 配置虚拟主机
- 翻译:用户变量(User-Defined Variable)(已提交到MariaDB官方手册)
- Linux中的15个‘echo’ 命令实例
- [MVC学习笔记]1.项目结构搭建及单个类在各个层次中的实现
- winform 显示控件层级关系
- linux磁盘分配最佳实践,干货再次来袭!Linux小白最佳实践:《超容易的Linux系统管理入门书》(连载八)用命令实现批量添加用户...
- 区块链:关键阻力的突破会带来持续的积极情绪
- 垃圾分类数据集+垃圾分类识别训练代码(支持googlenet, resnet, inception_v3, mobilenet_v2)
- 施一公:如何提高专业英文文献阅读能力?
- excel表格横向纵向变换_excel2016如何把纵向的数据变为横向
- qq 浏览器 android x86版,qq浏览器安卓版x86
- C++面向对象程序设计大作业:魔兽世界(三):开战
- Aardio 第一天:使用虚表和适配器+试融合Java
- 通过高德api获取经纬度
- linux 路由器pppoe拨号,linux下pppoe拨号上网
- python 是否可以一键修图_一键修图功能强大吗?想知道哪个软件比较好用?
- Linux多线程编程之pthread (多线程编程) --- (高级)---原作优秀