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