• 微信公众号:美女很有趣。 工作之余,放松一下,关注即送10G+美女照片!

Tomcat设置web 点击劫持 X-Frame-Options

开发技术 开发技术 3小时前 2次浏览

Tomcat配置

在 ‘conf/web.xml’填加以下配置

 

<filter>
        <filter-name>httpHeaderSecurity</filter-name>
        <filter-class>org.apache.catalina.filters.HttpHeaderSecurityFilter</filter-class>
        <init-param>
            <param-name>antiClickJackingOption</param-name>
            <param-value>SAMEORIGIN</param-value>
        </init-param>
        <async-supported>true</async-supported>
    </filter>
<filter-mapping>
        <filter-name>httpHeaderSecurity</filter-name>
        <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
</filter-mapping>

 


程序员灯塔
转载请注明原文链接:Tomcat设置web 点击劫持 X-Frame-Options
喜欢 (0)