Announcement Announcement Module
Collapse
No announcement yet.
Why doesnt CustomBooleanEditor work ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why doesnt CustomBooleanEditor work ?

    I have this code in my initBinder() method in my controller.

    binder.registerCustomEditor( Boolean.class, null, new CustomBooleanEditor( "Yes", "No", true));

    I keep getting the error-
    Failed to convert property value of type [java.lang.String] to required type [boolean] for property freeFlag; nested exception is java.lang.IllegalArgumentException: Invalid boolean value []

    whats wrong ??????

    In my JSP I have
    <spring:bind path="freeflagerror.freeFlag">
    <select id="menu_option" name="freeFlag">
    <c:choose>
    <c:when test="${empty freeflagerror.freeFlag}">
    <option value="" selected>
    </option>
    <option value="Yes">
    Y
    </option>
    <option value="No">
    N
    </option>
    </c:when>

    <c:when test="${freeflagerror.freeFlag}">
    <option value="Yes" selected>
    Y
    </option>
    <option value="No">
    N
    </option>
    <option value="">
    </option>
    </c:when>

    <c:otherwise>
    <option value="No" selected>
    N
    </option>
    <option value="Yes">
    Y
    </option>
    <option value="" >
    </option>
    </c:otherwise>
    </c:choose>
    </select>
    </spring:bind>

  • #2
    ok i got the error..I had the flag as boolean instead of Boolean in the domain object...thx

    Comment

    Working...
    X