出現異常
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"。
