Announcement Announcement Module
Collapse
No announcement yet.
Simple binding question Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Simple binding question

    Hi. The following code appears in the web page in case of data binding error.

    The question is how can I remove it and instead of it place a (malicious-)user friendly message?

    Code:
    Failed to convert property value of type [java.lang.String] to required type [org.mayhem.identity.Gender] for property info.gender; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [org.mayhem.identity.Gender] for property gender: no matching editors or conversion strategy found

  • #2
    In general how can I supply my own binding error messages?

    Comment


    • #3
      In your resource bundle have a property such as
      Code:
      typeMismatch.propertyName = My own error message
      The error message will be displayed when there is a casting error.

      Comment


      • #4
        What do you mean by "casting error"?

        For example I have this enum: Gender {FEMALE, MALE} , and when I supply MAL, instead of MALE, there is no casting error, as defined by the JLS

        What I need is an interface which resolves the error messages, for me to supply my own implementation/extension

        Comment


        • #5
          Anyway it works for both cases... Thanks
          Last edited by sandstorm; Dec 4th, 2008, 12:14 PM.

          Comment

          Working...
          X