下面列出了freemarker.template.TemplateModelException#printStackTrace ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@After("pointcut()")
public void after(JoinPoint joinPoint) {
Map config = configService.getConfigs();
if (null == config) {
log.error("config为空");
return;
}
Long updateTime = ((Date) config.get(ConfigKeyEnum.UPDATE_TIME.getKey())).getTime();
if (updateTime == configLastUpdateTime) {
log.debug("config表未更新");
return;
}
log.debug("config表已更新,重新加载config到shared variable");
configLastUpdateTime = updateTime;
try {
configuration.setSharedVariable("config", config);
} catch (TemplateModelException e) {
e.printStackTrace();
}
}
@Override
public void onApplicationEvent(ApplicationStartedEvent event) {
try {
this.loadActiveTheme();
} catch (TemplateModelException e) {
e.printStackTrace();
}
this.loadOptions();
this.loadOwo();
//启动定时任务
// CronUtil.start();
log.info("The scheduled task starts successfully!");
}
@Override
public void onApplicationEvent(ApplicationStartedEvent event) {
try {
this.loadActiveTheme();
} catch (TemplateModelException e) {
e.printStackTrace();
}
this.loadOptions();
this.loadThemes();
this.loadOwo();
//启动定时任务
CronUtil.start();
log.info("The scheduled task starts successfully!");
}
@Override
public void onApplicationEvent(ApplicationStartedEvent event) {
try {
this.loadActiveTheme();
} catch (TemplateModelException e) {
e.printStackTrace();
}
this.loadOptions();
this.loadThemes();
this.loadOwo();
//启动定时任务
CronUtil.start();
log.info("The scheduled task starts successfully!");
}
/**
* 添加自定义标签
*/
@PostConstruct
public void setSharedVariable() {
configuration.setSharedVariable("zhydTag", customTags);
configuration.setSharedVariable("articleTag", articleTags);
try {
configuration.setSharedVariable("config", configService.getConfigs());
//shiro标签
configuration.setSharedVariable("shiro", new ShiroTags());
} catch (TemplateModelException e) {
e.printStackTrace();
}
}