Avatar of Rohit Bajaj
Rohit Bajaj
Flag for India

asked on 

how to set common header for all RequestMappings in a controller

In my controller i have the following line in each requestMapping method :
        response.setHeader(contentSecurityolicy.getHttpHeader(), contentSecurityPolicy.toString());

Open in new window

There are 4 such methods... Is there any way i can avoid this so as to specify this header only once in controller and
it gets added to all the responses ?

JavaJava EE

Avatar of undefined
Last Comment

8/22/2022 - Mon