学习SpringBoot时遇到了一个这样的错误,一开始以为自己的代码有问题,百度了下发现时传参的时候有问题,我传的参是int类型的,改成integer对象类型就行了
[dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: Optional int parameter 'limit' 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.] with root cause
改好的是这样的:
仅作自己记录使用
Optional int parameter ‘limit‘ is present but cannot be translated into a null value due to错误解决方法
最新推荐文章于 2023-07-31 15:28:45 发布