aojiaodebaihuBlog

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

分类:

技术点:

相关文章:

  • 2021-07-21
  • 2021-08-24
  • 2021-08-10
  • 2021-05-25
  • 2021-09-11
  • 2022-01-02
  • 2021-08-08
猜你喜欢
  • 2021-06-09
  • 2021-10-25
  • 2021-07-01
  • 2021-04-21
  • 2022-01-12
  • 2022-01-13
  • 2021-07-31
相关资源
相似解决方案