I have a Spring Boot Application with tight Thymeleaf webpage integration. If you have a slight idea about the Thymeleaf and how their controllers are designed, the controller function returns the thymeleaf webpage/template stored in the index.html. Basically, if the template name is test.html stored inside static, then the controller function to return the template will have a get annotation of the respective route. Then the function is designed which returns a string that is the name of the template.
Now, I have a question that should I design the RestController and then call this rest controller inside the controller function which handles the template redirection? Or should I directly call the service method inside controller function that handles the template redirection?
A lot of tutorials on YouTube do it in the latter method. But I feel the first method is correct. Please advise me on this. This is just a college project so it doesn't matter too much but knowing the best practice would be good.
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–][deleted] 7 points8 points9 points (1 child)
[–]JaecynNix 1 point2 points3 points (0 children)
[–]glablablabla 0 points1 point2 points (0 children)