使用来自 jar 外部来源的模板

时间:2021-06-18 22:23:09

标签: java spring spring-boot groovy thymeleaf

我正在尝试从我的 applications.properties 文件内部访问文件系统中 jar 外部的文件。我创建了一个带有前缀 mail.sink-service 的邮件配置类,我试图设置其属性。好像找不到模板。这是我迄今为止一直在尝试的:

spring.thymeleaf.prefix=classpath:./dataflow/templates/
mail.sink-service.template-location=classpath:./dataflow/templates/newnotice
mail.sink-service.source-base-name=classpath:./dataflow/templates/

我也试过使用这样的文件:

spring.thymeleaf.prefix=file:./dataflow/templates/
mail.sink-service.template-location=file:./dataflow/templates/newnotice
mail.sink-service.source-base-name=file:./dataflow/templates/

而且我都用这种格式试过了:

spring.thymeleaf.prefix=file:./templates/
mail.sink-service.template-location=file:./templates/newnotice
mail.sink-service.source-base-name=file:./templates/

我也尝试过使用绝对路径,但我遇到了同样的问题。

这是我的文件结构:

file structure

0 个答案:

没有答案
相关问题