You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stephen Rosman <fl...@gmail.com> on 2008/08/01 03:57:22 UTC

What's the status of the wiki?

Has the wiki at http://wiki.apache.org/cocoon/ been abandoned by 2.2?
There still seems to be some content added sporadically but only for
2.1.

-- 
Stephen Rosman

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


Cannot create a session after the response has been committed

Posted by Hugh Sparks <hu...@csparks.com>.
I have a webapp I've been using since the coccon 2.1x era.
It still works with 2.2.1. It is a simple one page cform
that uses ajax.

But today, I felt the need to enable exception handling 
in the sitemap. As soon as I did, I saw that the webapp
was throwing an exception and it stopped working:

"Cannot create a session after the response has been committed"

If I remove the exception handler, the program appears to work.

It seems I've been doing something wrong for years without knowing it. 

I tore apart the flowscript and found that the error was
caused when there were global variables in the script.
As soon as I made them all local, the problem went away.

I understand that somehow global variables in flowscript
are attached to the session. But nowhere in my program is
the session handled explicity. But evidently, I should be
doing something else to make this work. I do need the
variables to be global and attached to the session.

Here is an entire flowscript that demonstrates the problem:

WORKS:

 cocoon.load("servlet:forms:/resource/internal/flow/javascript/Form.js") ;

 function startup()
 {     var form = new Form("form.xml");
        form.showForm("form-display") ;
 }

DOESN'T WORK

 cocoon.load("servlet:forms:/resource/internal/flow/javascript/Form.js") ;

 var form ;

 function startup()
 {     form = new Form("form.xml");
        form.showForm("form-display") ;
 }

I don't know if this matters, but the script never uses a
"send page and wait." In the real script, there are functions
associated with all the fields and buttons.

The pipeline for the display and continuation handling are
copies taken from the samples.

How should I be dealing with the session to avoid this error?

Thanks to all,

-Hugh Sparks


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