Announcement Announcement Module
No announcement yet.
BindException typeMismatch String Long SFC Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • BindException typeMismatch String Long SFC

    I'm using SimpleFormController and am getting a BindException and a typeMismatch when the springframework attempts to convert a string having numeric content into a Long.

    The actual message is :

    Rendering view with name 'spoc/joborder/edit' with model {[email protected] 97, org.springframework.validation.BindException.comma nd=org.springframework.validation.BindException: BindException: 1
    errors; Field error in object 'command' on field 'jobOrderId': rejected value [[Ljava.lang.String;@4e94a4]; codes [typeMismatch.command.jobOrderId,typeMismatch.jobOr derId,,typeMismatch]; arguments [MessageSourceResolvable: codes [command.jobOrderId,jobOrderId]; arguments []; default message [jobOrderId]]; default message [Failed to
    convert property value of type [[Ljava.lang.String;] to required type [java.lang.Long] for property 'jobOrderId'; nested exception is java.lang.NumberFormatException: For input string: "18,18"]} and static attributes {}

    The code in the JSP looks like :
    <input type="hidden" name="jobOrderId" value="18" />

    Is Spring supposed to handle this out of the box?

    If not what are the methods I should override?