摘抄官方文档: spring boot配置 iframe同源可访问
2016-10-17 12:37
666 查看
使用java配置,跟spring security配置在一起
如果是使用xml配置:
@EnableWebSecurity public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http // ... .headers().frameOptions().sameOrigin().httpStrictTransportSecurity().disable(); } }
如果是使用xml配置:
<http> <!-- ... --> <headers> <frame-options policy="SAMEORIGIN" /> <hsts disable="true"/> </headers> </http>
相关文章推荐
- springboot-application.properties.配置清单,官方文档
- spring boot 官方文档翻译之 配置log4j
- Spring Boot 官方文档学习(一)入门及使用
- u-boot-2012.10 官方文档翻译--配置选项
- Spring 4 官方文档学习(⑥)Web MVC 框架之配置Spring MVC
- SpringBoot(四):静态资源的访问和配置
- spring boot配置简单rest服务,访问404
- spring-boot官方文档翻译——第三部分
- Spring 4 官方文档学习(九)数据访问之事务管理
- Spring Boot属性文件application.properties配置文档(全部)
- Spring 4 官方文档学习(十)数据访问之JDBC
- SpringBoot 配置 Druid1.1.6【官方配置】
- spring-boot-starter-data-redis 翻译官方文档 6.1 - 6.4
- spring boot flyway 配置说明(摘抄)
- 杨品的文档之--spring-boot集成jsp配置
- Spring 4 官方文档学习(十一)Web MVC 框架之配置Spring MVC
- spring boot 官方文档笔记
- Spring Boot 数据访问集成 MyBatis 与事物配置
- 为spring-boot-admin配置spring security(用于控制访问)
- SpringBoot配置SwaggerUI访问404错误的解决方法