Answer the question
In order to leave comments, you need to log in
What is the best way to output to the controller in spring boot?
Is there a difference between the output of the controller in these 2 options, and if so, which is better and why?
1:
@GetMapping("/home")
public String mydogs( Map model) { model.
put("some","hello");
return "mydogs";
}
2:
@GetMapping("/home")
public String mydogs(Model model) {
model.addAttribute("some", "hello");
return "mydogs";
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question