반응형
Exception processing template "/main": Error resolving template [/main], template might not exist or might not be accessible by any of the configured Template Resolvers
이란 오류가 발생했다.
분명 로컬에선 잘 돌아갔는데 호스팅했을땐 안돼서 몇시간을 삽질했는데,
다음의 구글링을 통해 그 원인을 알게됐다.
https://myserena.tistory.com/155
에 따르면 view에 대한 path를 다음과 같이 /main으로 했었기 때문에 //main 으로 되어 path해석이 불가능했던것이다.
그러면 왜 내 local, Intellj에선 실행이 됐지?(헷갈리게 말이다..)
When you’re running in your IDE the resource is available straight off the filesystem and the double slash doesn’t cause a problem. When you’re running from a jar file the resource is nested within that jar and the double slash prevents it from being found.
-> //에대한 처리는 IDE에서는 처리를 해 주고, jar 배포시에는 처리를 못한다.
그래서 return "main" 으로 수정해줬더니 해당 path로 잘 return된것을 확인할 수 있었다.
'Study > SpringBoot' 카테고리의 다른 글
[SpringBoot] 로그인 및 회원가입 처리 -(Spring Security 사용) (0) | 2022.05.11 |
---|---|
[SpringBoot] 타임리프 if문 (0) | 2021.11.29 |
[SpringBoot]@Mapper (0) | 2021.10.10 |
[SpringBoot] 서블릿 예외 처리 (0) | 2021.09.04 |
[Spring Boot]스프링 인터셉터 (0) | 2021.09.03 |