I have a question about redirection in a Grails web stream. I am in a view state that will allow users to enter answers to a question. With 2 incorrect attempts, I can redirect the user to view the page from another controller. I mean
challengeQuestionOne{
onRender() {
}
on('next') {BuildQuestion command ->
bindData(flow.recovery,command)
[return the model to flow]
if(command.hasErrors()) {
flow.command = command
return error()
}
if(check for status. If doesnot pass){
flash.message=message(code:'loginForm.account.locked', default: 'Please Contact Admin.')
redirect(controller : "login",action: "login")
}
if (
}
else{
}
}.to("challengeQuestionTwo")
on(Exception).to("error")
on('cancel').to('finish')
}
I tried redirecting from onRender. He was redirected to the page. But how to display an error message on a redirected page. How can I redirect the error message from one controller to another?
source
share