Field error in object 'xxx' on field 'XXX': rejected value [];


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: ""]


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM