博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Spring Boot 出现 in a frame because it set 'X-Frame-Options' to 'DENY'
阅读量:4615 次
发布时间:2019-06-09

本文共 796 字,大约阅读时间需要 2 分钟。

在spring boot项目中出现不能加载iframe

页面报一个"Refused to display 'http://......' in a frame because it set 'X-Frame-Options' to 'DENY'. "错误

解决方式:

因spring Boot采取的java config,在配置spring security的位置添加:

@Overrideprotected void configure(HttpSecurity http) throws Exception {       http.headers().frameOptions().disable();     http      .csrf().disable();     http      .authorizeRequests()             .anyRequest().authenticated();            http.formLogin()          .defaultSuccessUrl("/platform/index",true)          .loginPage("/login")          .permitAll()        .and()          .logout()           .logoutUrl("/logout");            http.addFilterBefore(wiselyFilterSecurityInterceptor(),FilterSecurityInterceptor.class);              }
转载请说明 出处 谢谢!!!

 

转载于:https://www.cnblogs.com/weitaming/p/7424333.html

你可能感兴趣的文章
深入理解MySQL的ACID四大特性原理
查看>>
Codeforces Round #463 F. Escape Through Leaf (李超线段树合并)
查看>>
@ResponseBody 注解是什么意思?
查看>>
Code4App地址
查看>>
蓄水池抽样
查看>>
C#与数据库访问技术总结(十五)之 DataAdapter对象代码示例
查看>>
Sublime Text 插件推荐——for web developers
查看>>
Grails中service的线程安全的小例子
查看>>
MySQL与Oracle(二)---日期对比(MySQL)
查看>>
懵懂的第一周
查看>>
OpenFileDialog对话框Filter属性
查看>>
树链剖分
查看>>
poj2886线段树(单点修改,区间查询)
查看>>
通过JazzyViewPager来实现Fragment页面间的动画切效果
查看>>
golang map和for循环的查找效率对比
查看>>
struts2中服务器端数据校验
查看>>
form表单里的坑
查看>>
Vs2010+opencv2.3.1 imread出现异常
查看>>
Restful --- 让JSON回归单纯
查看>>
★如何解释特修斯之船问题?
查看>>