Announcement Announcement Module
Collapse
No announcement yet.
Message source won't resovle error codes. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Message source won't resovle error codes.

    Here's my messages.properties in WEB-INF/classes:

    Code:
    typeMismatch=Invalid date.
    monkeyMessage=You are a giant monkey!
    Here's my app context:

    Code:
    <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
        <property name="basename"><value>messages</value></property>    
    </bean>
    Here's a jsp file snippet:

    Code:
    <fmt&#58;message key="monkeyMessage"/>
    ...
    <c&#58;forEach items="$&#123;errors.allErrors&#125;" var="error">
     $&#123;error.code&#125;
     <li><c&#58;out value="$&#123;error.defaultMessage&#125;"/></li>
    </c&#58;forEach>
    And here's the output:

    Code:
    You are a giant monkey!
    typeMismatch
    Failed to convert property value of type &#91;java.lang.String&#93; to required type &#91;java.util.Date&#93; for property 'birth'; nested exception is java.lang.IllegalArgumentException&#58; Could not parse date&#58; Unparseable date&#58; "asdfasdf"
    As you can see, I've debugged this thing like crazy, I've had my nose in Spring source all day, and I'm just about going nuts. Any help at all would be greatly apreciated. Thanks!

  • #2
    Try a property key of:
    typeMismatch.java.util.Date
    or
    typeMismatch.yourPropertyName

    Comment


    • #3
      Yea, none of those combinations seem to do it either.

      Comment

      Working...
      X