今天的一个问题是试出来的,有点沾沾自喜
问题描述: 看到某个网站对pdf的预览效果特好,于是自己动手也想实现出来,报了个错 Refused to display … in a frame because it set ‘X-Frame-Options’ to ‘DENY’.
我的项目用到了spring security,版本4.2.5,我先怀疑是security的权限问题,后来发现不是, 然后我在jsp的添加了个meta标签 < meta http-equiv=“X-Frame-Options” content=“sameorigin”> 还是不起作用, 然后看到两个博主的文章受到启发,
https://blog.csdn.net/lizy928/article/details/82535089
https://blog.csdn.net/yangfanj/article/details/80858831
于是我就想能不能再spring security的配置文件了进行配置了,于是就猜是http标签下 然后利用idea的强大的提示功能试出来了
<security:http auto-config="true" use-expressions