Implementations of the ITemplateResolver
interface that extend the base org.thymeleaf.templateresolver.AbstractTemplateResolver
class (like all out-of-the-box implementations do) have a resolvablePatterns
property that allows you to specify a series of patterns that will be applied for determining which views will be considered resolvable by that specific template engine. This should help you avoid collisions.
There you can specify wildcarded patterns like admin/*
, user/*/create
, etc.
Have in mind that these patterns apply on the view name, and not on the template file name itself. For example, if your template is /WEB-INF/templates/index.html
and your view resolver adds prefix /WEB-INF/templates/
and suffix .html
, your view name is index
, and so a resolvable pattern like *.html
would never match.
Also, there is an order
property that establishes the order in which template resolvers will be asked to resolve a view.
Disclaimer, as required by StackOverflow rules: I'm the author of Thymeleaf.