Spring MVC & Thymeleaf
I'm using IntelliJ (latest stable) on some Spring MVC project with Thymeleaf as template engine. Everything works fine until i changed my configuration from XML files to annotations. Configuration is same, nothing changed. Specifically resolving views not working anymore.
Configuration:
@EnableWebMvc
@Configuration
public class Config extends WebMvcConfigurationSupport {
@Autowired
public SpringTemplateEngine templateEngine;
@Bean
@Override
public ViewResolver mvcViewResolver() {
ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
viewResolver.setTemplateEngine(templateEngine);
return viewResolver;
}
@Bean
public ITemplateResolver templateResolver() {
ServletContextTemplateResolver templateResolver = new ServletContextTemplateResolver();
templateResolver.setPrefix("/WEB-INF/templates/");
templateResolver.setSuffix(".html");
templateResolver.setTemplateMode("HTML5");
templateResolver.setCharacterEncoding("UTF-8");
templateResolver.setCacheable(false);
return templateResolver;
}
@Bean
public SpringTemplateEngine templateEngine(ITemplateResolver templateResolver) {
SpringTemplateEngine templateEngine = new SpringTemplateEngine();
templateEngine.setTemplateResolver(templateResolver);
templateEngine.setMessageSource(messageSource());
templateEngine.addDialect(new LayoutDialect());
return templateEngine;
}
}
In result of this - navigation between views not working but shows error messages instead "no view resolvers found":
And also (the really annoying part) - variable validation and completion not working for views:
Spring context is defined as:
There is no support for this case or i'm doing something wrong?
Please sign in to leave a comment.


Indeed Annotation-based Spring MVC configuration is not supported yet. Please watch https://youtrack.jetbrains.com/issue/IDEA-132738 and https://youtrack.jetbrains.com/issue/IDEA-87346 for progress.
I'm currently evaluating Idea and have really liked it so far. We're using Thymeleaf in many of our projects, and I'm wondering why there is not much progress on this issue?
I hope to provide the first enhancements in this area very soon in IntelliJ IDEA 15 Early Access Program.
So this feature will work in the next major release (15)? From the previous release dates I assume it will be released in 5-6 months?
1) Probably
2) Yes