0

I started developing a Spring MVC + Thymeleaf (for the V) recently and I'm trying to understand how it works.

Let's say I have a controller method like this:

@RequestMapping(value = "/")
public String index() {
    return "home";
}

And a template called home.html.

What is reponsible for routing the controller to the respective view? Is it thymeleaf? Or the Spring framework?

Thank you

1

1 Answer 1

3

Spring's ViewResolver(s) do this: https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/servlet/ViewResolver.html

Which view resolver(s) are active and where they look for templates is customizable based on your individual Spring configuration.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.