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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:53:07+00:00 2026-05-25T01:53:07+00:00

I’m using inputText to get input from a user <h:inputText id=firstName value=#{beanManager.currentUser.firstName } required=true

  • 0

I’m using inputText to get input from a user

<h:inputText id="firstName" value="#{beanManager.currentUser.firstName }" required="true"        style="font-size: 15px"></h:inputText>

and then I’ve added a message tag

<h:message for="firstName"></h:message>

but when the inputtext is blank and I press submit I get this error message:

> j_id_jsp_1382885624_1:ID: Validation Error: Value is required.

how can I display the error message only as this?

> Validation Error: Value is required.

here is the code:

    <f:view>
    <h:form>
        <h:panelGrid border="1" columns="3" style="width: 643px; ">
            <h:outputText value="First Name" style="font-size: 25px; font-weight: bold"></h:outputText>
            <h:outputText value="Last Name" style="font-size: 25px; font-weight: bold"></h:outputText>
            <h:outputText value="ID" style="font-size: 25px; font-weight: bold"></h:outputText>
            <h:inputText id="firstName" value="#{beanManager.currentUser.firstName }" required="true" requiredMessage="Enter a Valid First Name" style="font-size: 15px"></h:inputText>
            <h:inputText id="LastName" value="#{beanManager.currentUser.lastName }" required="true" requiredMessage="Enter a Valid Last Name" style="font-size: 15px"></h:inputText>
            <h:inputText id="ID" value="#{beanManager.currentUser.ID}" required="true" requiredMessage="Enter a Valid ID"  style="font-size: 15px">
                </h:inputText>
            <h:form><h:commandButton action="#{beanManager.save }" value="Save Changes" style="height: 30px; width: 100px"></h:commandButton>       
            </h:form>
        </h:panelGrid>
        <h:commandLink action="backtopersonalview" value="Back To Users" style="height: 30px; width: 100px">
                </h:commandLink>
    </h:form>
</f:view>
  • 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-25T01:53:08+00:00Added an answer on May 25, 2026 at 1:53 am

    Yes, it’s possible.

    To the current message, I can say that it consists out of form id, item id and default message.

    <form_id>:<item_id>: <default_message:javax.faces.component.UIInput.REQUIRED>
    

    If you want to change the default message, you could do this with a message bundle, which you have to define in your faces-config.xml.

    <application>
        <locale-config>
            <default-locale>en</default-locale>
            <supported-locale>en</supported-locale>
        </locale-config>
        <resource-bundle>
            <base-name>com.stackoverflow.messages.language</base-name>
        </resource-bundle>
    </application>
    

    And change the value for javax.faces.component.UIInput.REQUIRED.

    For example your message bundle language.properties could contain:

    javax.faces.component.UIInput.REQUIRED=Your new required message!
    

    Mostly all JSF implementations comes with the following default message, which I’ve copied from Mojarra:

    javax.faces.component.UIInput.REQUIRED={0}: Validation Error: Value is required.
    

    It’s also possible to define a required message to an single item with the requiredMessage attribute. Then your <h:inputText /> should look like this:

    <h:inputText id="firstName" value="#{beanManager.currentUser.firstName }" required="true" requiredMessage="Your new required message!" style="font-size: 15px">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from
I'm making a simple page using Google Maps API 3. My first. One marker
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.