I have got an Spring MVC project (AppFuse) and Flash attributes are not transmitted to the GET request.
What I do: In the transmitter method:
@RequestMapping(method = RequestMethod.POST)
public String onSubmit(Entity entity, BindingResult errors, HttpServletRequest request, HttpServletResponse response, RedirectAttributes ra){
...
ra.addFlashAttribute("id", entity.getId().toString());
success = "redirect:somePage";
...
return success;
}
In the receiver method, I cannot get the passed flash attribute. I tried these approaches:
- by ModelMap
- by Model
- by @ModelAttribute("id")
The issue is in the redirecting string. Working one is:
More correct solution is:
Double slash redirect is also non-working: