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":
1.png

And also (the really annoying part) - variable validation and completion not working for views:

1.png

Spring context is defined as:

Bez názvu.png

There is no support for this case or i'm doing something wrong?

5 comments
Comment actions Permalink

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.

0
Comment actions Permalink

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?

0
Comment actions Permalink

I hope to provide the first enhancements in this area very soon in IntelliJ IDEA 15 Early Access Program.


0
Comment actions Permalink

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?

0
Comment actions Permalink

1) Probably
2) Yes

0

Please sign in to leave a comment.