본문 바로가기

IT/Spring

[Spring] thymeleaf-layout-dialect WARN 해결

2021-02-15 16:28:54 [http-nio-8080-exec-79] [WARN ] n.n.u.t.d.DecoratorProcessor - The layout:decorator/data-layout-decorator processor has been deprecated and will be removed in the next major version of the layout dialect.  Please use layout:decorate/data-layout-decorate instead to future-proof your code.  See https://github.com/ultraq/thymeleaf-layout-dialect/issues/95 for more information.
2021-02-15 16:28:55 [http-nio-8080-exec-79] [WARN ] n.n.u.t.e.ExpressionProcessor - Fragment expression "layout/login_layout" is being wrapped as a Thymeleaf 3 fragment expression (~{...}) for backwards compatibility purposes.  This wrapping will be dropped in the next major version of the expression processor, so please rewrite as a Thymeleaf 3 fragment expression to future-proof your code.  See https://github.com/thymeleaf/thymeleaf/issues/451 for more information.
2021-02-15 16:28:55 [http-nio-8080-exec-79] [WARN ] n.n.u.t.fragments.FragmentProcessor - You don't need to put the layout:fragment/data-layout-fragment attribute into the <head> section - the decoration process will automatically copy the <head> section of your content templates into your layout page.

 

 

spring boot web server를 구동하는 도중 위와 같은 warn 3개가 출력되었습니다.
위 로그의 내용은 일부 문법이 deprecated되어 변경하라는 경고 글입니다.

내용을 요약하자면 다음과 같습니다.

1. layout:decorator="layouts/my-layout"을 layout:decorate="~{layouts/my-layout}" 로 변경하라

2. config fragment를 지우고 공통 css, js, image들을 layout의 <head></head> 안에 넣어라. 그리고
content에서 사용되는 각각의 css, js image들은 content html 내 head에 넣어라.
content html이 렌더링 될 때, 자동으로 layout head에 추가된다.