Q:

Spring boot - Thymeleaf template - multiple resolvers

We have multiple thmeleaf template resolvers in our project.
Our project structure,
/src/main/java/*.java
/src/main/resources/pages/*.html
/src/main/resources/templates/*.html

Inside, resources, we have pages and templates folder.
So, have to add one more view resolvers to have html files inside pages.
@Configuration
public class ThymeleafConfig {

    @Autowired
    private SpringTemplateEngine templateEngine;

    @PostConstruct
    public void init() {
        ClassLoaderTemplateResolver resolver = new ClassLoaderTemplateResolver();

        resolver.setPrefix("pages/");
        resolver.setSuffix(".html");
        resolver.setTemplateMode("LEGACYHTML5");
        resolver.setOrder(templateEngine.getTemplateResolvers().size());

        templateEngine.addTemplateResolver(resolver);
    }

}

Now, would like to move few files to /srs/main/webapp/
/src/main/resources/
/src/main/webapp/*.html

SO, tried the above config file with,
resolver.setPrefix("webapp/");

tried the below code also,
 resolver.setPrefix("/webapp/");

Now, getting the following error.
2015-10-27 15:36:13.078 [http-nio-8080-exec-8] ERROR org.thymeleaf.TemplateEngine - [THYMELEAF][http-nio-8080-exec-8] Exception processing template "agent": Error resolving template "agent", template might not exist or might not be accessible by any of the configured Template Resolvers
2015-10-27 15:36:13.094 [http-nio-8080-exec-8] ERROR o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: Error resolving template "agent", template might not exist or might not be accessible by any of the configured Template Resolvers] with root cause
org.thymeleaf.exceptions.TemplateInputException: Error resolving template "agent", template might not exist or might not be accessible by any of the configured Template Resolvers
    at org.thymeleaf.TemplateRepository.getTemplate(TemplateRepository.java:246) ~[thymeleaf-2.1.4.RELEASE.jar:2.1.4.RELEASE]
    at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1104) ~[thymeleaf-2.1.4.RELEASE.jar:2.1.4.RELEASE]

Any other configuration to be done for webapp folder ...

A:

Changing the ClassLoaderTemplateResolver to ServletContextTemplateResolver solved the problem. I guess, duo to the security reasons, ClassLoaderTemplateResolver unable to read the file under webapp.
@PostConstruct
    public void init() {
        ServletContextTemplateResolver resolver = new ServletContextTemplateResolver();

        resolver.setPrefix("/");
        resolver.setSuffix(".html");
        resolver.setTemplateMode("LEGACYHTML5");
        resolver.setOrder(templateEngine.getTemplateResolvers().size());

        templateEngine.addTemplateResolver(resolver);
    }

