Announcement Announcement Module
Collapse
No announcement yet.
BindException typeMismatch String Long SFC Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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 {command=com.rhi.bob.board.spoc.JobOrderImpl@119c2 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.java.lang.Long,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?

    Thanks!
Working...
X