I'm working on an old Spring project where I want to update some field in the view from my post request.
I have tried the following with no luck:
@RequestMapping(value="/dashboard/{calories}", method=RequestMethod.POST)
public void updateCals (@PathVariable Long calories, Model model, HttpSession session, HttpServletRequest request, HttpServletResponse response) {
request.getSession().setAttribute("tea", tea);
model.addAttribute("tea", tea);
}
Should I add a return or redirect at the end? Any help would be greatly appreciated