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
Post a Comment