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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:12:03+00:00 2026-05-20T10:12:03+00:00

I have a form page that has an inputText field that accepts a date.

  • 0

I have a form page that has an inputText field that accepts a date. We have a converter that converts the string from the textbox into a Date object (ie. “2011-03-01” to java.util.Date(“2011-03-01″”) )

If the string is not a date, like “123” then a validation error message will be displayed like “value (123) must be a date”.

Currently, in my .properties file, I see:

javax.faces.converter.DateTimeConverter.DATE=value
({0}) must be a date

I need to make this error message more clear by specifying exactly which field must be a date. (As there could be more than one date text fields on the form).

I would like to change it to something like:

javax.faces.converter.DateTimeConverter.DATE=The
field “{0}” with value ({1}) must be a
date

However, I am unsure how JSF automatically fills in the {0} and {1}. How do I specify my own variables inside the JSF Converter error message?

Note: I have added tried creating my own validator (not to be confused with converter) but it seems that the JSF framework does conversion before validation in its lifecycle.

  • 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-20T10:12:03+00:00Added an answer on May 20, 2026 at 10:12 am

    Starting from JSF 1.2, use the converterMessage attribute to replace the entire message, such as:

    <h:inputText value="#{user.dateOfBirth}" converterMessage="Format must be: yyyy-MM-dd">
        <f:convertDateTime pattern="yyyy-MM-dd" />
    </h:inputText>
    

    Otherwise, JSF by default shows the _detail message in the <h:message>. Only when you use <h:message showDetail="false" showSummary="true"> then the one similar as in your question will be displayed. I’m not sure what JSF version you’re using, but in my JSF 2.0.3 the default detail message for f:convertDateTime is the following:

    javax.faces.converter.DateTimeConverter.DATE_detail = {2}: ''{0}'' could not be understood as a date. Example: {1}
    

    The {2} will be substituted with the client ID or the label attribute of the input field when present.

    <h:inputText value="#{user.dateOfBirth}" label="Date of birth">
        <f:convertDateTime pattern="yyyy-MM-dd" />
    </h:inputText>
    

    Both the DATE and DATE_detail message must be defined for the DATE_detail message to be used:

    javax.faces.converter.DateTimeConverter.DATE=Date format must be: dd/mm/yyyy 
    javax.faces.converter.DateTimeConverter.DATE_detail=Date format must be: dd/mm/yyyy
    

    See also:

    • JSF 2.0 tutorial – Finetuning validation
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have simple aspx page that has a form and a input field in
I have a page that has several ajax submission forms. Each form has a
I have A single page that has the following structure <form runat=server><placeholder></placeholder></form> I have
I have a form page in PHP that reads a DBF, and conditionally converts
I have a site that has a big form page and about half of
I have a form on a simple web page that has a series of
I have a page that has a Contact Form slide down when a link
I have form on my page that has the following code <form class=form> ...
I have a import file page that has a form with a file input
I have a JSF page that has a h:form that has some textfields 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.