缺少X-Frame-Options头
web.xml
<filter>
<filter-name>authFilter</filter-name>
<filter-class>
com.server.web.filter.AuthFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>authFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
AuthFilter.java
package com.server.web.filter;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
public class AuthFilter implements Filter {
protected static ApplicationContext ac;
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain filterChain) throws IOException, ServletException {
HttpServletResponse res = (HttpServletResponse)response;
res.addHeader("x-frame-options","SAMEORIGIN");
filterChain.doFilter(request, res);
}
public void init(FilterConfig fc) throws ServletException {
ac = WebApplicationContextUtils.getRequiredWebApplicationContext(fc.getServletContext());
}
public void destroy() {
}
}