#16 board : thymeleaf - decoupled logic setting
This commit is contained in:
@@ -33,6 +33,7 @@ dependencies {
|
|||||||
compileOnly 'org.projectlombok:lombok'
|
compileOnly 'org.projectlombok:lombok'
|
||||||
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
||||||
annotationProcessor 'org.projectlombok:lombok'
|
annotationProcessor 'org.projectlombok:lombok'
|
||||||
|
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
|
||||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||||
|
|
||||||
// queryDSL 설정
|
// queryDSL 설정
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ package com.example.board;
|
|||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
|
||||||
|
|
||||||
|
@ConfigurationPropertiesScan
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class BoardApplication {
|
public class BoardApplication {
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.example.board.config;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.boot.context.properties.ConstructorBinding;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class ThymeleafConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public SpringResourceTemplateResolver thymeleafTemplateResolver(
|
||||||
|
SpringResourceTemplateResolver defaultTemplateResolver,
|
||||||
|
Thymeleaf3Properties thymeleaf3Properties
|
||||||
|
) {
|
||||||
|
defaultTemplateResolver.setUseDecoupledLogic(thymeleaf3Properties.isDecoupledLogic());
|
||||||
|
|
||||||
|
return defaultTemplateResolver;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Getter
|
||||||
|
@ConstructorBinding
|
||||||
|
@ConfigurationProperties("spring.thymeleaf3")
|
||||||
|
public static class Thymeleaf3Properties {
|
||||||
|
/**
|
||||||
|
* Use Thymeleaf 3 Decoupled Logic
|
||||||
|
*/
|
||||||
|
private final boolean decoupledLogic;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -28,6 +28,8 @@ spring:
|
|||||||
rest:
|
rest:
|
||||||
base-path: /api
|
base-path: /api
|
||||||
detection-strategy: annotated
|
detection-strategy: annotated
|
||||||
|
thymeleaf3:
|
||||||
|
decoupled-logic: true
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user