class ThymeleafSvgConfig implements ApplicationContextAware {

    @Bean
    public ITemplateResolver svgTemplateResolver() {
        final SpringResourceTemplateResolver svgTemplateResolver = new SpringResourceTemplateResolver();
        svgTemplateResolver.setApplicationContext(applicationContext);
        svgTemplateResolver.setPrefix("classpath:/templates/svg/");
        svgTemplateResolver.setTemplateMode(TemplateMode.XML);
        svgTemplateResolver.setCharacterEncoding("UTF-8");
        svgTemplateResolver.setOrder(0);
        svgTemplateResolver.setCheckExistence(true);
        return svgTemplateResolver;
    }

}