cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Watler <rwat...@finali.com>
Subject Using sitemap redirect-to from flow sendPage()?
Date Wed, 28 Jan 2004 01:36:53 GMT
I have been experimenting with a Woody based login form that invokes a
standard Authentication Framework login pipeline using
cocoon.sendPage(), (in a recent 2.1.4-dev build). When the pipeline
completes with a redirect-to, the redirect fails to occur in the browser
and it is left with a blank page and a continuation url. I assume this
problem is a special case of the general "redirect fails after generator
in pipeline issue". I have verified that the If I instead code the
flowscript below to use cocoon.redirectTo() to access the pipeline, it
works correctly. Of course, the login pipeline then must be public and
urls that travel to the browser have private information in them. Before
I set about recoding, I wanted to make sure my assumption is correct and
get any input on how this can be better done. Here are the related sources:

Flowscript:
----------------------------------------------------
cocoon.load(
"resource://org/apache/cocoon/woody/flow/javascript/woody2.js" ) ;

function loginForm()
{
    // setup form
    var form = new Form( "definitions/login-form-def.xml" ) ;

    // display form
    form.showForm( "login-form-display-pipeline" ) ;

    var model = form.getModel() ;
    cocoon.sendPage( "test?user="+model.user+"&pass="+model.pass ) ; //
fails to redirect
    // cocoon.redirectTo( "test?user="+model.user+"&pass="+model.pass )
; // redirects via browser properly
}

Pipeline:
--------------------------------------------------

<map:match pattern="test">
    <map:act type="auth-login">
        <map:parameter name="handler" value="admin"/>
        <map:parameter name="parameter_user" value="{request-param:user}"/>
        <map:parameter name="parameter_pass" value="{request-param:pass}"/>
        <map:redirect-to uri="home"/>
    </map:act>
    <map:redirect-to uri="login"/>
</map:match>

Thanks in advance,

Randy Watler
Finali Corporation



Mime
View raw message