Skip to content

Commit 40bfed6

Browse files
committed
Update freemarker DirectoryForTemplateLoading
Signed-off-by: yutao04 <[email protected]>
1 parent 149c5be commit 40bfed6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hango-api-plane-server/src/main/java/org/hango/cloud/configuration/ApiPlaneAutoBaseConfiguration.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@
2626
import org.springframework.http.client.ClientHttpRequestInterceptor;
2727
import org.springframework.http.client.InterceptingClientHttpRequestFactory;
2828
import org.springframework.http.client.SimpleClientHttpRequestFactory;
29+
import org.springframework.util.ResourceUtils;
2930
import org.springframework.web.client.RestTemplate;
3031

3132
import javax.annotation.PostConstruct;
33+
import java.io.IOException;
3234
import java.time.Duration;
3335
import java.util.List;
3436

@@ -89,7 +91,8 @@ ObjectMapper jsonObjectMapper() {
8991
}
9092

9193
@PostConstruct
92-
void configureFreemarkerConfig() {
94+
void configureFreemarkerConfig() throws IOException {
95+
freemarkerConfig.setDirectoryForTemplateLoading(ResourceUtils.getFile("classpath:template"));
9396
freemarkerConfig.setNumberFormat("#");
9497
freemarkerConfig.setSharedVariable("indent", new IndentationDirective());
9598
freemarkerConfig.setSharedVariable("ignore", new IgnoreDirective());

0 commit comments

Comments
 (0)