I have an app using Spring, JPA (Hibernate) and the Java validation framework (Hibernate Validator). I would like to be able to annotate fields in our domain model that are allowed to contain HTML and have them automatically sanitized at commit time. Anyone know a clever way to do this?
I have tried using the validation framework but this does not support modifying the value of the field at validation time. I could hack things to get something working but am hoping for a cleaner solution.