SSM中,前端搜索條件為空時,value為“”,傳值時無法轉換為int,會導致加載controller之前就報錯,故應把屬性值得類型改為Integer,即可接收到null
Field error in object 'xxx' on field 'XXX': rejected value [];
codes [typeMismatch.XXX.xxx,typeMismatch.xxx,typeMismatch.int,typeMismatch];
arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [XXX.xxx,xxx]; arguments [];
default message [xxx]];
default message [Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'xxx'; nested exception is java.lang.NumberFormatException:
For input string: ""]