Optional int parameter 'category_id' is present but cannot

Optional int parameter 'category_id' 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.

在这里插入图片描述
1.将Controller层category_id类型改为Integer;
2.如果出现如下情况:

Request processing failed; nested exception is java.lang.NullPointerException

必须判断category_id是否为空.

猜你喜欢

转载自blog.csdn.net/CSDN19951017/article/details/84068095