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

  • Home
  • SEARCH
  • 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 6780615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:31:36+00:00 2026-05-26T16:31:36+00:00

In my web application in JSF, some validators such as a length validator <f:validateLength></f:validateLength>

  • 0

In my web application in JSF, some validators such as a length validator <f:validateLength></f:validateLength>, a regular expression validator <f:validateRegex></f:validateRegex> and some other issue some error possibly a warning even if they are functioning well with no problem at all, when the JSF page is loaded.

The JSF ManagedBean is unnecessary here and the submit button presented in the following code has nothing to do with, since Ajax is fired on the valueChange event of the text field given.

Following is the simple JSF page code.


<?xml version='1.0' encoding='UTF-8' ?>
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core">

<h:head>
    <title>Demo</title>
</h:head>
<h:body>
    <h:form>
        <center><br/><br/><br/>
        <h:inputText id="txtDemo" required="true" requiredMessage="Mandatory." 
            validatorMessage="The field should contain al least 10 digits">

            <f:validateLength id="lenValidator" for="txtDemo" maximum="10" 
            minimum="2"/>

            <f:validateRegex pattern="[0-9]*" for="txtDemo" id="txtPattern"/>

            <f:ajax id="txtAjax" event="valueChange" execute="txtDemo msg" 

            render="txtDemo msg"/>
        </h:inputText><br/>

        <h:message id="msg" for="txtDemo" showDetail="true" style="color:red"/>
        <br/>
        <h:commandButton id="btnSubmit" value="Submit"/>
        </center>
    </h:form>
</h:body>


In the above code, although the validators <f:validateLength></f:validateLength> and <f:validateRegex></f:validateRegex> are functioning well, the length validator does not allow less than 2 and greater than 10 characters and the regular expression validator ensures that the field should contain only digits, red colored messages appear on the console, when this JSF page is load. The messages displayed are as follows.

SEVERE: /Restricted/TempTags.xhtml @12,93 id="lenValidator" Unhandled by MetaTagHandler for type javax.faces.validator.LengthValidator

SEVERE: /Restricted/TempTags.xhtml @13,82 id="txtPattern" Unhandled by MetaTagHandler for type javax.faces.validator.RegexValidator

Why are these messages displayed, event if they are functioning well with no problem?

  • 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-26T16:31:37+00:00Added an answer on May 26, 2026 at 4:31 pm

    It’s just telling that the id attribute of those tags is not been handled. Indeed, those tags do not support an id attribute. Remove it.

    <f:validateLength for="txtDemo" maximum="10" minimum="2"/>
    <f:validateRegex for="txtDemo" pattern="[0-9]*" />
    

    The for attribute is by the way unnecessary in this construct. You could also safely remove it. The for attribute applies only when targeting validators on inputs inside composite components.

    See also:

    • JSF 2.1 tag documentation
      • <f:validateLength> tag documentation
      • <f:validataRegex> tag documentation

    Unrelated to the concrete problem, the <center> element is deprecated since HTML 4.01 in 1998. Remove it as well. Use CSS margin: 0 auto on the containing block element with a fixed width instead.

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

Sidebar

Related Questions

I have a JSF Web application, and at some point i present the client
I programmed an application with JSF and some other fraeworks. Then I destroyed my
consider a JSF web application with a managed bean FooBean.java. I've declared this FooBean
i have a JSF web application. I use Beans as Spring Beans (not JSF
I am developing a web application based on JSF technology. I use Eclipse as
I am developing a JSF web application on a Windows box using Emacs as
I have a Java-JSF Web Application on GlassFish, in which I want to use
i'am using JSF and Spring in a web application. If the Spring Controller throws
I try to run jsf application in myeclipse using jboss web server and following
I am using JSR 303 Bean validation in my JSF 2.0 web application and

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.