I have a form with 3 fields, and submit button. when button clicked, if none is entered in 3 fields, throw validation message. If any one of the 3 fields are entered process
Just let the required attribute of each field check the presence of the submitted value of the other fields. The submitted value is available in the parameter map #{param} by the client ID as key.
Here's a kickoff example:
It gets only more ugly as the amount of fields grows.
Alternatively, you can use OmniFaces
Please note that performing validation in action method is bad design. You should use the standard JSF validation facilities for this such as requiered, validator, and/or .