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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -