以后在springmvc接受参数的时候,尽量不要使用基本数据类型

Optional int parameter 'currpage' is present but cannot be translated into a null value due to being dec

大意是说 如果参数是非必须的,则会赋值为null,因此参数应该是一个object,它才能接受这个null值。

而上面代码参数currpage的类型 为 int,它接受不了null值。

解决方法:

将int 改为 对象类型 Integer :

posted @ 2019-12-30 16:26  陈哈哈V  阅读(728)  评论(0)    收藏  举报