FE/html

img 태그 엑박

잔망루피 2022. 10. 11. 19:23
반응형

src 경로가 잘못되어서 or Spring Security에서 차단

 

 

🌿 해결

1. 이미지 파일을 static 폴더로 옮겼다.

<img src="../../파일명.png">

이미지를 사용하는 HTML 파일이 templates/user 아래에 있었다.

나의 경우는 파일 구조가 아래와 같았다.

 

resources

  • static
    • 이미지.png
  • templates
    • user
      • 파일.html

 

2. Spring Security 설정에서 antMatchers().permitAll()에 "/*"를 추가했다.

 

 

 

참고 👇

https://stackoverflow.com/questions/44455900/spring-security-login-page-images

 

Spring security login page - images

i'm a newbie. I'm trying to developp a webapp using Spring. I have a custom login page where i want to insert an image. How can i do? I've red all of the questions on SO but no one worked for me.....

stackoverflow.com

 

반응형