这个问题我回答过,取数据时把integer型字段转化成string型,表单里age按字串型处理就是了

解决方案 »

  1.   

    还有没有其它答案???
    上面二位的回答,貌似不太理想!
    User类是一个pojo,我们用了 hibernate
      

  2.   

    问题终于解决了:
    Have the customized typeMismatch message in your message properties
    file that Spring load as messageResource.Example:
    # For generic error message on type mismatch Date
    typeMismatch.java.util.Date={0} is an invalid date.# For specific error message on perticular form field
    # (e.g. startDt is a form field name)
    typeMismatch.startDt=Start Date is an invalid date.