java - Redirect to another controller with a @PathVariable -


how redirect controller path variable in redirect. tried following way error:

java.lang.illegalargumentexception: model has no value key 'formid'

how implemented it:

long formid = drugtype.getformid();             view = "redirect:/pub/req/customform/view/{formid}"; 

and received controller:

@requestmapping(method = requestmethod.post,  value = "/pub/req/customform/view/{formid}") string completecustomform(@pathvariable long formid,         @valid @modelattribute customformlayout customformlayout,         bindingresult errors, httpservletrequest request, model model,         redirectattributes attr) { 

any ideas how can redirect controller formid value?

try applying parameter:

long formid = drugtype.getformid(); view = "redirect:/pub/req/customform/view/"+formid; 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -