How to perform JSF validation in actionListener or action method?
I have Bean validation working nicely in my application. Now I want to check that a new user does not choose a username that has already been chosen. In the actionlistener I have the code that checks the database but how do I force the user to be sent back to the page they were on if they choose an already existing username? BalusC Introduction You can do it, but JSF ajax/action/listener methods are semantically the wrong place to do validation. You actually don't want to get that far in JSF lifecycle if you've wrong input values in the form. You want the JSF lifecycle to stop after JSF