I have an User object stored in the session with @SessionAttributes. And a straight-forward method decorated with @ModelAttribute in o
User
@SessionAttributes
@ModelAttribute
How about this approach -
@RequestMapping(value = "/{id}", method = RequestMethod.GET) public String showItem(@PathVariable("id") Long id, Model uiModel) { User user = (User)uiModel.asMap().get("user"); ... }