Results 1 to 5 of 5

Thread: Simple binding question

  1. #1
    Join Date
    Jul 2008
    Posts
    239

    Default 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. #2
    Join Date
    Jul 2008
    Posts
    239

    Default

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

  3. #3
    Join Date
    Oct 2008
    Location
    Delhi, India
    Posts
    163

    Default

    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.

  4. #4
    Join Date
    Jul 2008
    Posts
    239

    Default

    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

  5. #5
    Join Date
    Jul 2008
    Posts
    239

    Default

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •