일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
- 2961 도영이가 만든 맛있는 음식
- django settings.py
- 1188 음식 평론가
- django httpd error
- 18233 러버덕
- windows apache wsgi 에러
- django windows 배포 에러
- windows 원격 연결 설정
- apache pythonpath
- java di
- 2661 좋은 수열
- django The requested operation has failed!
- 2643 java
- 공유기 원격 설정
- django
- 18233 비트마스킹
- 2643 색종이 올려 놓기
- 1188 java
- 18233 java
- 2661 java
- Problems occurred while performing provisioning operation
- APPEND_SLASH = FALSE
- django 프로젝트 시작
- 2961 java
- 14711 java
- django 웹 페이지
- django apache deploy error
- The requested operation has failed!
- 14711 타일 뒤집기
- 원격 연결 포트 포워딩
라이브러리는 도서관 아닌가요
Spring boot gradle jsp 사용 본문
스프링 부트에서는 jsp 사용을 권장하지 않는다.
따라서 기본적으로 templates 경로에 있는 .html 파일을 찾아 읽게 되는데,
여기서 .jsp를 사용하려면 문제가 발생한다.
따라서 개별적으로 의존성을 추가하고, 설정을 수정하며, 폴더 경로를 추가한다.
build.gradle
implementation 'javax.servlet:jstl'
implementation 'org.apache.tomcat.embed:tomcat-embed-jasper'
* 주의할 점은 thymeleaf에 관한 설정인,
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
이 녀석이 없어야 한다는 것이다.
만약 있다면, 멀쩡한 프로젝트에서도 아래와 같은 에러를 볼 수 있다.
There was an unexpected error (type=Internal Server Error, status=500).
Error resolving template [경로], template might not exist or might not be accessible by any of the configured Template Resolvers
JSP view path
spring.mvc.view.prefix=/WEB-INF/views/
spring.mvc.view.suffix=.jsp
경로에 해당하는 폴더 추가
기본적으로 src/main/webapp/WEB-INF/views 까지는 만들어줘야 한다.
webapp은 JSP가 사용하는 default 경로인 것으로 보인다.
다시 한 번 말하지만 thymeleaf 충돌 주의