0

I've been working through some of the Spring tutorials at:

http://spring.io/guides

And i'm looking specifically at:

http://spring.io/guides/gs/serving-web-content/

And it's really unclear to me how the Spring model resolves using the proper .html file. Could anyone explain this or provide links? Is it naming convention?

1 Answer 1

3

In the example request from the link you provided the return value is the name of the view that will be rendered.

@RequestMapping("/greeting")
public String greeting(@RequestParam(value="name", required=false, defaultValue="World") String name, Model model) {
    model.addAttribute("name", name);
    return "greeting";
}

The default view resolver for Thymeleaf will automatically append .html. See here.

The tutorial for Thymeleaf and Spring integration is here.

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.