• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to display custom validation message for a drop down.  RSS feed

 
Durga Krishna
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

I have a dropdown in my application.

I would like to do JSF validation for this dropdown.

If I give required="true", it is giving its own validation error message.

Instead I would like to display a custom error message like 'Please select the state.'

Please let me know how I can display a custom validation message.
 
Sumeet Singh Aryan
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's very easy to implement. either right your own custom validator class or write the validator method in your bean and call it as a validator attribute in JSF tags. for more clarification follow the following link

http://java.dzone.com/articles/jsf-validation-tutorial-error

 
Sweta Ann
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


See the section

How to use standard conversion and validation features in JSF in http://jsflessons.blogspot.com

It is clearly explained in it.



 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!