Below is my class in which i had to use both @Configuration
and @Controller
as there should be only one instance of Thymeleaf
in the e
Assuming you're using Spring Boot, since you have it in tags, you do not need any configuration to use Thymeleaf.
By just having this dependency, you can:
@GetMapping("/view-template")
public String viewTemplates(Model model) {
model.addAttribute("mydata", "this is it")
return "view-to-process";
}
And it should work.
By the way, yes, having @Configuration
and @Controller
in the same class is something you should never need.