java.lang.IllegalStateException: Optional int parameter 'pageSize' is present but cannot be translat
来源:互联网 发布:js给span标签赋值 编辑:程序博客网 时间:2024/05/19 20:18
我的spring mvc 代码:
报错:
继续查看出错内容:
大意是说 如果参数是非必须的,则会赋值为null,因此参数应该是一个object,它才能接受这个null值。
而上面代码参数page 的类型 为 int,它接受不了null值。
解决方法:
将int 改为 对象类型 Integer :
问题解决。阅读全文
0 0
- java.lang.IllegalStateException: Optional int parameter 'pageSize' is present but cannot be translat
- java.lang.IllegalStateException: Optional int parameter 'currentSpecialIndex' is present but cannot
- Optional int parameter 'folderId' is not present but cannot be translated into a null value due to b
- Optional int parameter 'id' is present but cannot be translated into a null value due to being decla
- Optional int parameter 'page' is present but cannot be translated into a null value due to being dec
- Optional int parameter 'version' 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 value due to being decla
- Optional int parameter 'rip' is present but cannot be translated into a null value due to being decl
- Optional int parameter 'topicId' 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 value due to being decla
- Optional int parameter 'pageNumber' is present but cannot be translated into a null value due to bei
- Required int[] parameter 'ids' is not present
- nested exception is java.lang.IllegalStateException: Ambiguous mapping. Cannot map ***
- java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Int
- java.lang.IllegalStateException: File has been moved - cannot be read again
- 文件上传 ,java.lang.IllegalStateException: File has been moved - cannot be read again org.springframewor
- java.lang.IllegalStateException: File has been moved - cannot be read again
- nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframewo
- C# 三种动态调用WebService的方法,测试通过
- tnsnames.ora的目录
- 聊聊高并发(三十五)Java内存模型那些事(三)理解内存屏障
- Python 是如何找模块的呢?
- 上传文件-java.lang.NoSuchFieldException: resourceEntries
- java.lang.IllegalStateException: Optional int parameter 'pageSize' is present but cannot be translat
- C语言选择排序
- HTML中     &thinsp等空白空格的区别
- Wide character in print at check_cert.pl line 18.
- 关于感知学习模型机中空间任一点到超平面的距离公式的推导过程
- Java配置问题一:has value '1.8', but '1.7' is required.
- 启动Producer报错kafka Failed to send messages after 3 tries
- int与宽字符的转化
- 主观和客观