【发布时间】:2019-08-31 08:28:42
【问题描述】:
我有一个 SpringBoot 2.1.7.RELEASE 应用程序。使用 Thymeleaf 模板引擎 我在 Thymeleaf 模板中添加了这段代码,但图像没有显示出来
<object data="assets/img/icons/ico_status_up.svg" type="image/svg+xml">
<img th:src="@{assets/img/icons/ico_status_up.png}" alt="UP">
</object>
我在浏览器的控制台中看到了这个错误:
Refused to display 'http://localhost:8080/bonanza/pecador/assets/img/icons/ico_status_up.svg' in a frame because it set 'X-Frame-Options' to 'deny'.
我在我的项目中使用 spring-security:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<!-- Spring Security -->
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity5</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
【问题讨论】:
-
您在项目中使用 Spring Security 吗?
标签: html spring spring-boot spring-mvc thymeleaf