I am writing a spring application and for every page I return the same view and populate it with content fragments. Does anyone know if and how to set this view name so that I do not have to set it with every controller.
@RequestMapping("/Login")
public ModelAndView login(ModelAndView modelAndView) {
modelAndView.setViewName("default");
modelAndView.addObject("view", "login");
modelAndView.addObject("title", "Login");
modelAndView.addObject("jsNeeded", true);
return modelAndView;
}
This is an example of a controller. I would like to not have to repeat the
modelAndView.setViewName("default");