0

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.

Pramod S. Nikam
  • 4,271
  • 4
  • 38
  • 62

1 Answers1

2

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.

Pablo Lozano
  • 10,122
  • 2
  • 38
  • 59
  • 1
    +1 for adding a filter. I would totally do both XSS and XSRF prevention checks in a filter. – govin Oct 16 '14 at 07:55