How can I configure HTTP Response Headers in a Struts2 Interceptor?
问题 We currently have a java web application in the middle of migration from Struts 1 to Struts 2. We would like to configure X-Frame-Options and Content-Security-Policy headers for all our Struts 2 actions. We have a lot of actions and I want to avoid modifying them all separately if at all possible. the idea I currently have is the following interceptor which would be added to the default stack: import javax.servlet.http.HttpServletResponse; import org.apache.struts2.ServletActionContext;