首页 > 技术文章 > Optional int parameter 'resourceState' is present but cannot be translated into a null value

cailijuan 2019-08-07 17:12 原文

错误日志:

java.lang.IllegalStateException: Optional int parameter 'resourceState' 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.

原因:

 controller层接收数字型参数resourceState时用的int接收,但是参数为空null,所以报错,将int改为Integer即可

推荐阅读