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 -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -