I have a question. I'm working on some EJB3 session beans which are the business logic for a few JSF pages. Currently, both the JSF pages as well as my methods seperately check if certain method parameters conform to specific rules (length min/max, matches specific regex, etc.). I dont like having to do this twice but since the beans can be called from places thay may not do such validation I dont have much of a choice.
My question is this; is there a neat way to define such rules once and use them in both the beans and the JSPs? Is there a best practice for this?