Spring Boot Web Mvc: Pass variables to JSP page

Опубликовано: 10 Март 2025
на канале: Xavier Dupont
345
1

A controller can pass additional information along with the view. To do this, return a ModelAndView instead of the view name, then set your data in the model part.
Your data can be anything. Here, I used a String, but you can use any object, and even invoke object methods from JSP.