You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Vadim Gritsenko <va...@reverycodes.com> on 2008/04/01 02:28:09 UTC

Re: Redirect to GET, strange bug

On Mar 31, 2008, at 4:46 AM, Tobia Conforto wrote:
> I thought this would be easy to accomplish with continuations, but  
> I'm hitting a strange bug.  This is the utility function I'm calling  
> from my flows, AFTER the form has been processed (DB inserts, emails  
> sent, etc), just BEFORE doing the sendPage() with the result page:
>
> function redirectToGet() {
> 	var done = false;
> 	var cont = cocoon.createWebContinuation();
> 	if (! done) {
> 		done = true;
> 		cocoon.redirectTo('/cont=' + cont.id, true);

This redirect URL does not seem to be correct: should start with '?'  
if passing continuation id as parameter or have '/' instead of '=' if  
passing continuation id in URL path.


> 		cocoon.exit();

Hm, what is this exit() method? I don't see it defined neither in  
Cocoon 2.1 nor 2.2.

To terminate script processing and send redirect to browser you should  
be using suicide method. Something like that:

     cocoon.redirectTo('foo?cont=' + cont.id, true);
     FOM_Cocoon.suicide();


Vadim


> 	}
> }
>
> The problem is:
>
> - if I leave out the cocoon.exit(), I get:
> IllegalStateException: Pipeline has already been processed for this  
> request
>
> - if I put the cocoon.exit() as shown, I get:
> ProcessingException: Attempted to process incomplete pipeline
>
> What gives?
>
> I'm using Cocoon 2.1.10
>
> Tobia


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org