Question

I am usind Springsource Tools Suite and I want to develop a maven based web project. The parent archetype creator has used thymeleaf tags (th:block). It is working but I get warnings in STS that say: Unkown tag (th:block). How can i fix this warning?

Was it helpful?

Solution

Since I cannot add comment, I will write it here:

Check three things:

  1. Does maven contain thymeleaf dependencies? something like this.

  2. Do you have Thymeleaf resolver properly set: This is annotation example:

    @Bean
    public ThymeleafViewResolver viewResolver() {
        ThymeleafViewResolver thymeleafViewResolver = new ThymeleafViewResolver();
        thymeleafViewResolver.setTemplateEngine(templateEngine());
        thymeleafViewResolver.setCharacterEncoding("UTF-8");
        return thymeleafViewResolver;
    }
    
  3. Does your view have proper html tag:

    html xmlns="http://www.w3.org/1999/xhtml"
         xmlns:th="http://www.thymeleaf.org"
    

OTHER TIPS

In case of HTML, DTD wan't be parsed.

Try using Eclipse plugin (remember to add Thymeleaf nature to project): https://github.com/thymeleaf/thymeleaf-extras-eclipse-plugin

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top