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 7853875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:50:23+00:00 2026-06-02T19:50:23+00:00

My question is basically same as Custom validation message for bean validation . However,

  • 0

My question is basically same as Custom validation message for bean validation. However, I can’t fix the problem.

The bean class:

public class PersonalInfoBean {
    @Size(min=5, max=55, message="{invalid_name}")
    String name;
    ...
}

I created Messages.properties in a package in the src folder of Eclipse project.

invalid_name=Please enter a valid name

I registered the file in faces-config.xml:

<application>
    <message-bundle>com.webage.survey.Messages</message-bundle>
</application>

The facelet file has:

<h:inputText value="#{personalInfo.name}" id="name"/> <h:message for="name" style="color: red" /><br/>

When I submit the form, I see only {invalid_name} as error message and not “Please enter a valid name”.

I tested this with JBoss 6 and WebSphere 8 with the same result.

  • 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-02T19:50:25+00:00Added an answer on June 2, 2026 at 7:50 pm

    You’re mixing JSR 303 Bean Validation framework with JSF builtin validation. JSR 303 Bean Validation framework is not part of JSF framework. It’s an entirely standalone validation framework for which JSF just happens to have integration support.

    You need to specify the JSR 303 Bean Validation messages in a different properties file instead with the exact filename of ValidationMessages.properties, which can be localized with ValidationMessages_xx_XX.properties files. Those files have to be placed in the root of the classpath.

    You do not need to register it in faces-config.xml. The <message-bundle> is only used for JSF builtin converters and validators such as required="true", <f:validateRegex>, <f:convertDateTime>, etc.

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

Sidebar

Related Questions

I have basically the same problem outlined in this question, however I am using
Basically the same question as here How do I retain a ViewScoped bean on
This is basically the same question as Click items in select box, and then
Basically my question is the exact same one as this: Simple client/server, TCP/IP encrypting
I basically have the same question as this guy .. The example in the
Basically, I have the same question as this one , which unfortunately never got
SHORT VERSION OF QUESTION: So basically my question is: How can I set the
Basically the same functionality as stackoverflow when posting a question, if you start writing
Alright so my question isn't as professional as it can be. Basically I want
This question is basically the same as Silverlight keydown event for games but there

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.