Error resolving template ***, template might not exist or might not be accessible by any of the configured Template Resolvers

Azizov

I have spring boot + thymeleaf project, if I run project on the Intellij Idea, there is no problem, but When I run jar file, I faced this problem. This is error

org.thymeleaf.exceptions.TemplateInputException: Error resolving template [/login], template might not exist or might not be accessible by any of the configured Template Resolvers

This is errorjpg

vincent

it should be easier with some code, but here is a working example with spring boot and Maven.

I have a template called "myTemplate.html" in the folder src/main/resources/templates.

In one of my class I have :

ClassLoaderTemplateResolver templateResolver = new ClassLoaderTemplateResolver();
templateResolver.setSuffix(".html");
templateResolver.setTemplateMode(TemplateMode.HTML);

TemplateEngine templateEngine = new TemplateEngine();
templateEngine.setTemplateResolver(templateResolver);
Context context = new Context();
//... then here i fill all the variables used in my template

String filledTemplate = templateEngine.process("templates/myTemplate", context);

And everything works as expected

Hope it helps a bit :)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Error resolving template, template might not exist or might not be accessible by any of the configured Template Resolvers

Error resolving template [users/list], template might not exist or might not be accessible by any of the configured Template Resolvers

Error resolving template [/], template might not exist or might not be accessible by any of the configured Template Resolvers

Error resolving template "index", template might not exist or might not be accessible by any of the configured Template Resolvers

Error resolving template "login", template might not exist or might not be accessible by any of the configured Template Resolvers

Thymeleaf : template might not exist or might not be accessible by any of the configured Template Resolvers

template might not exist or might not be accessible by any of the configured Template Resolvers after deploy

TemplateInputException: Error resolving template ****, template might not exist

Deployed .war generating error: template might not exist or might not be accessible

Thymeleaf: Error Resolving Template

Error: Template Does Not Exist

Template does not exist error when template exists

Error resolving template - url mapping fails

TemplateInputException: Error resolving template [auth/login]

Error resolving thymeleaf template when replacing fragment

Spring boot ajax error with resolving template

template does not exist error in django?

Template variable not resolving everywhere

SpringBoot Thymeleaf Not Resolving Template

View variable is not accessible in template

Route data not accessible in template

AngularJS $scope not accessible in template

Spring boot - Thymeleaf template - multiple resolvers

multiple template resolvers (thymeleaf) in spring mvc

Regex capture set of groups that might or might not exist

problems with resolving friend function of template

Resolving template literals at a later context

Resolving template and const volatile type

Ansible template - Destination directory does not exist error