I am currently working on to safeguard application from XSS attacks. So I am checking that particularly for Every Request. This also can be checked at interceptors level.
But I want to decouple it with something like AOP's?
Any input from your experience is appreciable.
Thanks.
Adding a Filter is the easiest way to do this task, AOP is useful when you don't have any easy way to add transversal behavior/ functionality, but in this precise case is unnecessary. You can check how common it is just googling "java xss filter", there are plenty of examples.