Question: how to pass data from controller to jsp?
Answer: In order to pass data from controller to JSP, all you have to do is add a ModelMap argument to your controller method and then populate it inside your method body using the generic addAttribute() method. In the following example, we pass a welcome message from the controller by adding a message attribute to the model.