Returning View Name
Learn Returning View Name (Model & View, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Fresher Notes Returning a view name means the handler returns a String such as "home" ; Spring treats it as a logical view name, not as the response text. ViewResolver turns the logical name into a real view, for example home into /templates/home.html with Thymeleaf. @Controller needed : with @RestController or @ResponseBody the string is written to the body instead.