这个解决方法之所以新,在于情况比较特殊

我是用ssm框架,关于这个问题,我报错的原因不在于前端传到后端的值是null的情况,而是在控制器方法之间跳转时没有传参导致的,就是我写了redirect:"到另一个方法的RequestMapping";,但没注意要跳转到的方法里需要传int型参数。

而最为致命的是,运行出现错误的当前控制器的方法里也有一个同名的int参数,导致报错时,我一直以为是前端传到后端这个过程报错,却没考虑后端之间跳转出现错误。

如上图所示,下面这个方法运行完以后直接重定向到上面那个方法,而我一直在下面这个方法的参数列表里寻找原因,所以一直找不到原因。

希望该问题有参考意义,节省大家的时间。

解决该问题以后,

因为我之前写重定向就是为了不用再查一次,直接用已有的实现查询功能的方法,修正这个问题就老老实实再查一次就完了。

新的解决方法Optional int parameter ‘xxx_id‘ is present but cannot be translated int相关推荐

  1. 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 ...

  2. 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 ...

  3. Optional int parameter ‘id‘ is present but cannot be translated into a null value

    接收参数时遇到的问题 开始的代码 @RequestMapping("/deleteComment")@ResponseBodypublic ResultInfo deleteCom ...

  4. 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 ...

  5. 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 ...

  6. 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 ...

  7. 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 ...

  8. 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 ...

  9. 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 ...

最新文章

  1. 表变量是什么_为什么要使用二级指针?
  2. 网易内推java 面试_网易内推面试
  3. 启明云端分享|LVGL官方认证的开发板,到底有多牛
  4. Apache 配置虚拟主机
  5. 翻译:用户变量(User-Defined Variable)(已提交到MariaDB官方手册)
  6. Linux中的15个‘echo’ 命令实例
  7. [MVC学习笔记]1.项目结构搭建及单个类在各个层次中的实现
  8. winform 显示控件层级关系
  9. linux磁盘分配最佳实践,干货再次来袭!Linux小白最佳实践:《超容易的Linux系统管理入门书》(连载八)用命令实现批量添加用户...
  10. 区块链:关键阻力的突破会带来持续的积极情绪
  11. 垃圾分类数据集+垃圾分类识别训练代码(支持googlenet, resnet, inception_v3, mobilenet_v2)
  12. 施一公:如何提高专业英文文献阅读能力?
  13. excel表格横向纵向变换_excel2016如何把纵向的数据变为横向
  14. qq 浏览器 android x86版,qq浏览器安卓版x86
  15. C++面向对象程序设计大作业:魔兽世界(三):开战
  16. Aardio 第一天:使用虚表和适配器+试融合Java
  17. 通过高德api获取经纬度
  18. linux 路由器pppoe拨号,linux下pppoe拨号上网
  19. python 是否可以一键修图_一键修图功能强大吗?想知道哪个软件比较好用?
  20. Linux多线程编程之pthread (多线程编程) --- (高级)---原作优秀

热门文章

  1. 关于GoJs的总结及多功能实例
  2. 将视频托管到爱奇艺 (第一步)
  3. 加一度强烈推荐:信息流广告精准投放大杀器
  4. QML AbstractButton | Button | ButtonGroup | Action
  5. MySQL Delete 后,如何快速释放磁盘空间
  6. vue-grid-layout 的使用
  7. python安装annoy
  8. 十分钟开发物联网:智慧农业大棚环境监测(4G版)
  9. couchdb入门指南2——配置(包含集群设置)
  10. 【FPGA ZYNQ Ultrascale+ MPSOC教程】33.BRAM实现PS与PL交互