티스토리 뷰
thymeleaf 템플릿 엔진을 사용 중에 meta, link, input 태그 등을 닫지 않으면 아래와 유사한 에러 메시지가 뜹니다.
org.xml.sax.SAXParseException: Open quote is expected for attribute “charset” associated with an element type “meta”.
thymeleaf의 기본 설정이 아래 처럼 HTML5로 설정되어 있기 때문입니다.
spring.thymeleaf.mode = HTML5
html 파일들을 webpack 등을 이용해 빌드를 하는 경우 등 수작업으로 맞춰주기가 귀찮거나 번거로운 경우에는 thymeleaf 모드를 legacy html5 모드로 변경해주면 됩니다.
thymeleaf를 legcay html5 모드로 사용하기 위해선 다음와 같이 설정하면 됩니다.
application.properties
spring.thymeleaf.mode=LEGACYHTML5
pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId>
</dependency>'프로그래밍 > Spring' 카테고리의 다른 글
| spring-boot-starter-webflux swagger 3 설정 (0) | 2018.11.26 |
|---|---|
| Spring MVC Last-Modified, If-Modified-Since 캐시 설정 (0) | 2018.07.09 |
| Spring Boot + Vue.js 연동하기 (0) | 2017.12.29 |
| [JSTL] JSP 커스텀 태그 만들기 (0) | 2017.11.28 |
| [Spring Security] 현재 로그인한 사용자 정보 가져오기 (0) | 2017.09.07 |
댓글
Copyright ⓒ 2018 moneystory.blog. All rights reserved.
