The script for scrolling sites contains many rules to protect against XSS attacks. I would like to implement these suggestions in my web application that uses Spring MVC + Jackson + JPA + Hibernate Bean Validation. As an example, consider the following code, similar to what I have in my application.
public class MessageJson { @NotEmpty
I can see the following ways to implement winding rules:
- Option A Implement them manually in each controller method.
- Option B: Configure some extension on Spring MVC that can do this for me automatically
- Option C: Configure Jackson so that it can do this for me as most of my I / O goes through Jackson
I am looking for some SpringMVC configuration examples in any of these three options, with preference for options B and C.
source share