出现异常
nested exception is java.lang.IllegalStateException: Optional int parameter '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.
翻译:
嵌套异常为java.lang.IllegalStateException:存在可选的int参数'id',但由于被声明为原始类型,因此无法转换为null值。 考虑将其声明为相应原始类型的对象包装。
原因:
1、后台controller接收参数不能为空,前台传了空值。例如:int不能接收空值,integer可以接收空值。
2、前后台参数类型不一致,检查controller参数类型。
3、前台的参数过长导致丢失了参数,在tomcat的server.xml里面添加maxPostSize="0"。