I am new to grails.
My need is to append value to url such that...
from a controller, on
succes of some action
redirect to new url usingredirect function redirect(uri: "/login/auth")
.But my actual need is the resulting url should be like this
/login/auth?successMessage=Created
,so that i can take the value of successMessage in the resulting uri. so inorder to do this action what changes must be done in the redirection function of my above controller
how to append values to url in grails
346 views Asked by An Ish A At
2
You can use the
params
parameter ofredirect
which takes a map of parameters that get appended to the url.E.g.:
/edit:
To answer the question in the comments (in this case how can i compare value of successMessage in new url?):
Within the controller you can then check the value of
successMessage
usingparams.successMessage
: