Optional int parameter ‘isApply‘ is present but cannot be translated into a null value已解决
程序员文章站
2022-04-21 15:42:38
...
在项目中遇到的一个问题
java.lang.IllegalStateException: Optional int parameter 'isApply' 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.
at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.handleNullValue(AbstractNamedValueMethodArgumentResolver.java:250) ~[spring-web-5.3.4.jar!/:5.3.4]
at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.reso
解决方案
将isApply的类型改为对象类型不使用基本数据类型
private Integer isApply;
可以用包装类Integer来避免这个错误
在springmvc接受参数的时候,尽量不要使用基本数据类型
参考资料
https://blog.csdn.net/sinat_29774479/article/details/82497609
附:maven编译 Process terminated【已解决】
https://blog.csdn.net/weixin_44203158/article/details/105694724
上一篇: 关于thinkphp5框架的详细介绍
下一篇: php使用正则过滤js脚本代码实例
推荐阅读
-
Optional long parameter 'id' is present but cannot be translated into a null value due to being decl
-
Optional int parameter 'xx' is present but cannot be translated into a null value
-
Optional int parameter 'xx' is present but cannot be translated into a null value
-
Optional int parameter ‘productId‘ is present but cannot be translated into a null value
-
Optional int parameter ‘isApply‘ is present but cannot be translated into a null value已解决