zoukankan      html  css  js  c++  java
  • Spring boot与thymeleaf的集成

        # thymeleaf热部署
        spring.thymeleaf.cache=false

              @Value("${spring.thymeleaf.cache}")
              private boolean thymeleafCacheEnable = true;

             private ApplicationContext applicationContext;

              @Override
             public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
                         this.applicationContext = applicationContext;
              }


    /** * 模板资源解析器 * @return */ @Bean @ConfigurationProperties(prefix = "spring.thymeleaf") public SpringResourceTemplateResolver templateResolver() { SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver(); templateResolver.setApplicationContext(this.applicationContext); templateResolver.setCharacterEncoding("UTF-8"); templateResolver.setCacheable(thymeleafCacheEnable); return templateResolver; } /** * Thymeleaf标准方言解释器 */ @Bean public SpringTemplateEngine templateEngine() { SpringTemplateEngine templateEngine = new SpringTemplateEngine(); templateEngine.setTemplateResolver(templateResolver()); // 支持Spring EL表达式 templateEngine.setEnableSpringELCompiler(true); // 支持SpringSecurity方言 SpringSecurityDialect securityDialect = new SpringSecurityDialect(); templateEngine.addDialect(securityDialect); return templateEngine; } /** * 视图解析器 */ @Bean public ThymeleafViewResolver viewResolver() { ThymeleafViewResolver viewResolver = new ThymeleafViewResolver(); viewResolver.setTemplateEngine(templateEngine()); return viewResolver; }

      

  • 相关阅读:
    opencvadd加法
    opencvcopyMakeBorder拓展边界
    opencvcountNonZero计算非0值个数
    opencvcompare比较
    opencvputText绘字
    opencvaddWeighted加法
    opencvconvertScaleAbs位深转化函数
    opencvsplit分离通道
    软件测试的人际关系(转载)
    Struts 1.3.10 jar包官网下载地址
  • 原文地址:https://www.cnblogs.com/dibinbin/p/12091961.html
Copyright © 2011-2022 走看看