Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Create a custom validation error message in JSF

Diyan Yordanov
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have the following case:
Here is my code in the scope of a <h:form> tag

I want to customize my validation error message to accept parameters. Something like "signup_username_required={0} is too long" where {0} to be changed with the username invalid input value. I can not see a way to pass parameters to the: validatorMessage="#{Message.signup_username_maxlength}".

One mote thing. If a want to apply 2 validation rules on the username field, how can i define different validation error messages for each rule?

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic