【发布时间】:2021-06-29 18:10:16
【问题描述】:
我在application.properties 文件“footer_note”中有一个变量,现在我想将当前日期值存储在该变量中,但无法执行此操作。
我可以在我的 Java 代码中执行此操作,但要求是将当前日期值存储在 application.properties 文件中并从那里获取并显示它。
【问题讨论】:
标签: java spring spring-boot spring-mvc
我在application.properties 文件“footer_note”中有一个变量,现在我想将当前日期值存储在该变量中,但无法执行此操作。
我可以在我的 Java 代码中执行此操作,但要求是将当前日期值存储在 application.properties 文件中并从那里获取并显示它。
【问题讨论】:
标签: java spring spring-boot spring-mvc
你可以在main方法的springRun之前设置。
public static void main(String[] args) {
System.setProperty("footer.note",String.valueOf(System.currentTimeMillis()));
new SpringApplicationBuilder()....
}
【讨论】: