I\'m writing a HandlerInterceptor that needs to insert a certain session-scoped bean into the Model. postHandle\'s signature looks lik
HandlerInterceptor
Model
postHandle
Use modelAndView.addObject("key", value)
There are also some other indirect ways, through modelAndView.getModel() or modelAndView.getModelMap(). But you should prefer the addObject(..) version. In fact it invokes getModelMap().addAttribute(..)
modelAndView.getModel()
modelAndView.getModelMap()
addObject(..)
getModelMap().addAttribute(..)