Results 1 to 3 of 3

Thread: Message source won't resovle error codes.

  1. #1

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,104

    Default

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

  3. #3

    Default

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

Similar Threads

  1. UpgradeAcegi Security System from 0.6.1 to 0.8.3
    By mannobug in forum Security
    Replies: 3
    Last Post: Sep 23rd, 2005, 07:00 PM
  2. JBoss 3.2.6 & Spring Deployment issues
    By difranr in forum Container
    Replies: 2
    Last Post: Sep 18th, 2005, 10:08 PM
  3. Help: the boolean property exception!
    By linwei in forum Swing
    Replies: 2
    Last Post: Nov 17th, 2004, 07:11 PM
  4. listener tag exception
    By hyuan in forum Web
    Replies: 3
    Last Post: Nov 17th, 2004, 03:53 PM
  5. Replies: 6
    Last Post: Nov 8th, 2004, 06:43 AM

Posting Permissions

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