I am searching a way to check if a template exists before returning it in a view with Thymeleaf and Spring.
In my controller i was trying to do something like this:
String finalTemplate = template.getPrefix() + "/" + templateName;
try {
return finalTemplate;
} catch(TemplateInputException e) {
logger.debug("Sono qua");
return templateName;
}
but the exception is not catch...