title: Loading static resources with Spring Boot and Thymeleaf
body: <p>I want to get my static resources loaded. First I thought it already works, but that was just a trick of browser cache. I only get the html-files loaded as expected, but I dont get js, css, images and so on.</p>
  
  <p>======</p>
  
  <p><strong>My StartClass:</strong></p>
  
  <pre><code>@Configuration
  @Import({ ServiceConfig.class, WebMvcConfig.class })
  @EnableHypermediaSupport(type = HAL)
  @EnableAutoConfiguration
  public class ApplicationClientMvc {
      public static void main(final String[] args) {
          SpringApplication.run(ApplicationClientMvc.class, args);
      }
  }
  </code></pre>
  
  <p>======</p>
  
  <p><strong>WebMvcConfig</strong></p>
  
  <pre><code>@Configuration
  @ComponentScan
  public class WebMvcConfig extends WebMvcConfigurationSupport {
  
      @Autowired public SpringTemplateEngine templateEngine;
  
      @Bean
      public ThymeleafTilesConfigurer tilesConfigurer() {
          final ThymeleafTilesConfigurer configurer = new ThymeleafTilesConfigurer();
          configurer.setDefinitions("classpath*:/templates/**/views.xml");
          return configurer;
      }
  
      @Bean
      public ThymeleafViewResolver thymeleafViewResolver() {
          final ThymeleafViewResolver resolver = new ThymeleafViewResolver();
          resolver.setViewClass(ThymeleafTilesView.class);
          resolver.setTemplateEngine(templateEngine);
          resolver.setCharacterEncoding(UTF_8);
          return resolver;
      }
  
      @Bean
      public TilesDialect tilesDialect() {
          return new TilesDialect();
      }
  
      //
  
      @Value("${server.session-timeout}") private Long sessionTimeOut;
  
      @Override
      public void configureAsyncSupport(final AsyncSupportConfigurer configurer) {
          configurer.setDefaultTimeout(sessionTimeOut * 1000L);
          configurer.registerCallableInterceptors(timeoutInterceptor());
      }
  
      @Bean
      public TimeoutCallableProcessingInterceptor timeoutInterceptor() {
          return new TimeoutCallableProcessingInterceptor();
      }
  }
  </code></pre>
  
  <p>======</p>
  
  <p><strong>My Project Resoureces</strong></p>
  
  <p><img src="https://i.stack.imgur.com/uPOh0.png" alt="enter image description here"></p>
  
  <p>=====</p>
  
  <p><strong>Access to resoureces</strong></p>
  
  <p>Different styles of trying to get resource, no of them works!!!</p>
  
  <p><img src="https://i.stack.imgur.com/65yoK.png" alt="enter image description here"></p>