Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

이미지 경로 이슈 #2

Closed
Ohsaam opened this issue Jan 22, 2024 · 1 comment
Closed

이미지 경로 이슈 #2

Ohsaam opened this issue Jan 22, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Ohsaam
Copy link
Collaborator

Ohsaam commented Jan 22, 2024

⚠️이슈 내용

이미지를 업로드

  • 이미지 업로드 하려고 했는데, 계속 액박이 뜸

이미지액박

⚠️이슈코드

<img src="/images/WorkCon.png" alt="WorkCon Image"/>

✅예상 결과

  • 이미지 화면 상단 노출

WorkCon

@Ohsaam Ohsaam added the bug Something isn't working label Jan 22, 2024
@Ohsaam Ohsaam self-assigned this Jan 22, 2024
@Ohsaam
Copy link
Collaborator Author

Ohsaam commented Jan 22, 2024

해결

  • Context-Path를 고려하지 않았다. ㅜㅜ
<img src="<%=request.getContextPath() %>/images/WorkCon.png" alt="WorkCon Image"/>

이렇게 경로를 수정함. -> Context-path를 사용함.


당연히 Resources / images는 스프링부트에선 읽히는 줄 알고 이미지 경로를

<img src="/images/WorkCon.png" alt="WorkCon Image"/>

이렇게 적었다. 하지만, 당연히 Context-root도 인식하고 반영되는 줄 알았는데, 반영이 되지 않는 다는 것을 알게됐다.

이미지액박해결

@Ohsaam Ohsaam closed this as completed Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant