spring - Flash Attributes are not working -


i have got spring mvc project (appfuse) , flash attributes not transmitted request.

what do: in 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 receiver method, cannot passed flash attribute. tried these approaches:

  • by modelmap
  • by model
  • by @modelattribute("id")

the issue in redirecting string. working 1 is:

success = "redirect:/somepage"; 

more correct solution is:

success = "redirect:" + request.getcontextpath() + "/somepage"; 

double slash redirect non-working:

success = "redirect://somepage"; 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -