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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -