Announcement Announcement Module

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions ( project, this forum has been decommissioned in favour of Spring Extensions one at:

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Costin Leau
SpringSource - Spring Training, Consulting, and Support - "From the Source"
See more
See less
default messages to annotation validations Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • default messages to annotation validations

    I'm unable to get the default message to the validations on springmodules, i send my configuration:

    in, i have
    # message errors for the class User[not.blank]=Name is required
    User.surname[not.blank]=Surname is required[not.blank]=Email is required[email]=Not a valid email
    User.ssoId[validateSsoIdLength()]=Sso Id length incorrectly
    # message errors by default
    not.blank=Required default
    not.null=Required default
    expression=Invalid default
    email=Invalid email default
    length=Must be between {1} to {2} characters long default
    min.length=Must be at least {1} characters default
    max.length=Cannot be longer than {1} characters default
    In my bean, i have annotations to make the validation, and it works good.
    My problem is, that if i comment by example[not.blank] as you can see in the code, i can't get the default message "Required default" that must appear because of the properties.
    I get the errors defined for the bean, but not the default errors.
    I also try with

    errors.not.null={0} is a required field df.
    errors.not.blank={0} is a required field df.
    and doesn't work neither.

    In the jsp (the form that bind with the bean, i have the next code):
    <form:errors path="*">
    		<div class="errors">
    			<p><em><fmt:message key="errors.following.encountered"/></em></p>
                	<c:forEach items="${messages}" var="message">
                <p><fmt:message key=""/></p>

    What are the default message properties for the annotation based validator?
    Thanks, and sorry for my bad english.
    Last edited by cclafuente; Oct 16th, 2007, 02:56 AM. Reason: add new information

  • #2
    you might be interested in this post-