Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7713929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:59:41+00:00 2026-06-01T01:59:41+00:00

In my web application, I handle errors with annotations. Everything works fine and I

  • 0

In my web application, I handle errors with annotations. Everything works fine and I can use custom messages via the “message” parameter.

@Digits(fraction = 0, integer = 3, message="my custom error message...")
private String price;

Now I’m trying to internationalize this message with a .properties files, but I certainly miss something and I can’t get it to work.

My spring config :

<beans:bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
    <beans:property name="basenames" value="classpath:i18n/messages, classpath:i18n/errors" />
    <beans:property name="defaultEncoding" value="UTF-8" />
</beans:bean>

<beans:bean name="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
    <beans:property name="validationMessageSource">
        <beans:ref bean="messageSource" />
    </beans:property>
</beans:bean>

<beans:bean id="localeResolver" class="org.springframework.web.servlet.i18n.FixedLocaleResolver">
    <beans:property name="defaultLocale" value="fr" />
</beans:bean>

My new bean :

@Digits(fraction = 0, integer = 3)
private String price;

My “errors_fr.properties” file. I’ve already tried everything :

Digits.myBean.myNestedBean.price = my custom error message...
Digits.myNestedBean.price = my custom error message...
javax.validation.constraints.Digits.myNestedBean.price = my custom error message...

I always get the same generic message from spring, it’s like as spring doesn’t detect my .properties file. By the way, the message keys above can be found in the BindingResult object when debugging.

What am I missing here ?

Notice that I already have internationalized messages in my jsp’s (in the “messages_fr.properties” file) and they work fine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:59:42+00:00Added an answer on June 1, 2026 at 1:59 am

    I had a similar problem in my application, and I hope that this can help you.

    As discussed in this thread, http://forum.springsource.org/showthread.php?73240-Roo-JSR-303-Validations-and-Localization, you need to:

    1. define the error messages referred by the annotation in file ValidationMessages.properties
    2. in your annotation, refer to the error message key enclosed in curly brackets:

    @Digits(fraction = 0, integer = 3, message="{message.key}")

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a web application, and am wondering how to handle errors with my
I'm trying to handle AJAX errors in a web application that uses jQuery. I'm
I've been asked to write a web application in PHP to handle customers, sales,
My web application has a login page that submits authentication credentials via an AJAX
I am trying to re-architect a web application I developed to use the MVC
I have a .net application that uses customerrors web.config module to display meaningful messages
I have a Web Application which has Global_Asax and a Custom Error Page. When
My web application generates pdf files and either e-mails or faxes them to our
My web application sends email fairly often, and it sends 3 kinds of emails:
Our web application renders fast in some IE browsers, slow in others... It seems

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.