Grails Web Feed Redirection

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() {
                //Display question
            }
            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")//how to redirect from here to diff controller
                }                    
                if (//compare answer entered) {

                }
                else{
                   //set status not active
                }

            }.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?

+3
source share
2 answers

Ivo Houbrechts wrote an excellent Grails web stream tutorial:

Webflow -. , Grails ( , ), . , , - webflow, grails.

import org.springframework.web.context.request.RequestContextHolder
....
RequestContextHolder.currentRequestAttributes().flashScope.message = "YourMessage"

:

http://livesnippets.cloudfoundry.com/docs/guide/

+3

, . , . . . - :

<g:if test="${flowExecutionException}">
    <div class="error"><g:message code="loginForm.account.locked"/></div>
</g:if>
0

All Articles