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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:26:54+00:00 2026-05-28T00:26:54+00:00

I’m making a simple form with an input field implementing Bean Validation. All of

  • 0

I’m making a simple form with an input field implementing Bean Validation. All of the validations work fine. The issue is the message rendered (or lack of rendering) when the user enters a non numeric value:

  • If I use the @Pattern check in the Bean, no warning message is displayed in the view when the user enters a non numeric value.

  • If I remove the @Pattern from the Bean, the following warning message shows up when the user enters a non numberic value:

    “j_idt8:age: ‘some string’ debe ser un número entre -2147483648 y 2147483647. Ejemplo: 9346”

    which is translated to: “j_idt8:age: ‘some string’ must be a number between -2147483648 and 2147483647. Example: 9346”.

Is there anything I’m missing? Is there any way to implement a simple message warning? or is there anyway to customize the default message of: “j_idt8:age: ‘some string’ debe ser un número entre -2147483648 y 2147483647. Ejemplo: 9346”?

These are some code excerpt, in case you ask for them:

web.xml

<context-param>
    <description>JSF will interpret empty strings submitted values as null</description>
    <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
    <param-value>true</param-value>
</context-param>

user Bean:

@NotNull(message = "Please enter your age")
@Pattern(regexp = "[0-9][0-9]", message = "Age must be numeric")
@Max(99)
@Min(18)
private Integer age;

Facelets:

<h:form>
    Enter your age:<br/>
    <h:inputText id="age" value="#{user.age}">
        <f:ajax event="blur" render="ageMessage" />
    </h:inputText>
    <h:message id="ageMessage" for="age" /><br/>

    <h:commandButton value="Insert" action="#{user.showChoice}">
        <f:ajax execute="@form" render="@form" />
    </h:commandButton>
</h:form>
  • 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-05-28T00:26:54+00:00Added an answer on May 28, 2026 at 12:26 am

    You’re facing a conversion error, not a validation error. The problem manifests long before the validation can ever take place. It’s the builtin JSF String–Integer conversion which failed. Note that the @Pattern makes no sense on an Integer property. You cannot set it with an arbitrary String value.

    If you change the property to be a String, then you’ll see the “expected” results. But keeping it Integer is of course better if it should really represent a number. You can finetune the JSF converter message by the converterMessage attribute, or by supplying a custom Converter implementation, or by overriding the default message bundle file in <message-bundle>.

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

Sidebar

Related Questions

I have a text area in my form which accepts all possible characters from
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but

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.