i'm new to jEE, and this is my first jEE code using spring. The code bellow is working fine. He just print the string index when i go to my localhost; and otherwise he print handling error.
My question is: Why this code isn't working anymore if I use @Controller instead of @RestController
I can't find any simple explanation in the docs from spring and I was hoping someone could explain this.
I have the feelings that a controller alone can't work without something like thymeleaf (I know if I were using thymeleaf the string index would be replaced by the index page from the ressources folder) where a RestController might be returning data as xml or json or something else.
Thanks
@RestController public class HelloController implements ErrorController { @RequestMapping("/") public String index() { return "index"; } @RequestMapping("/error") public String error() { return "gestion erreur"; } @Override public String getErrorPath() { return "/error"; } }