You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Simone Gianni (JIRA)" <ji...@apache.org> on 2006/03/24 18:46:37 UTC

[jira] Created: (COCOON-1812) Javaflow and Ajax when sending two forms one after eachother

Javaflow and Ajax when sending two forms one after eachother
------------------------------------------------------------

         Key: COCOON-1812
         URL: http://issues.apache.org/jira/browse/COCOON-1812
     Project: Cocoon
        Type: Bug
  Components: Blocks: Forms, Blocks: Java Flow  
    Versions: 2.1.9-dev (current SVN)    
    Reporter: Simone Gianni
    Priority: Critical


In javaflow, if I try to send an ajax form and then send another ajax form I obtain a NPE originating from JXMacroHelper.

For example :

  FormInstance fi = new FormInstance("myform.def.xml");
  fi.show("mypipe");
  fi = new FormInstance("myotherform.def.xml");
  fi.show("myotherpipe");

I receive an NPE originating from JXMacroHelper:162  while showing the second forms.

After investigations i noticed that the second form was displayed following the ajax behaviour, while this second form is new and should not be "ajaxed". This causes the updatedWidgets list to be null (both in form and in JXMacroHelper) and thus the NPE.

Sniffing the http traffic showed me that while in javascript the submission of the first form causes a <bu:continue/> and a new non-ajax request from the browser, while with javaflow this does not happen.

Seems like the lines from 176 to 201 of /cocoon-2.1.X/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/Form.js were not ported to the javaflow FormInstance.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (COCOON-1812) Javaflow and Ajax when sending two forms one after eachother

Posted by "Simone Gianni (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/COCOON-1812?page=all ]

Simone Gianni updated COCOON-1812:
----------------------------------

    Attachment: javaflow-ajax.diff

Patch for javaflow ajax continue

> Javaflow and Ajax when sending two forms one after eachother
> ------------------------------------------------------------
>
>          Key: COCOON-1812
>          URL: http://issues.apache.org/jira/browse/COCOON-1812
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms, Blocks: Java Flow
>     Versions: 2.1.9-dev (current SVN)
>     Reporter: Simone Gianni
>     Priority: Critical
>  Attachments: javaflow-ajax.diff
>
> In javaflow, if I try to send an ajax form and then send another ajax form I obtain a NPE originating from JXMacroHelper.
> For example :
>   FormInstance fi = new FormInstance("myform.def.xml");
>   fi.show("mypipe");
>   fi = new FormInstance("myotherform.def.xml");
>   fi.show("myotherpipe");
> I receive an NPE originating from JXMacroHelper:162  while showing the second forms.
> After investigations i noticed that the second form was displayed following the ajax behaviour, while this second form is new and should not be "ajaxed". This causes the updatedWidgets list to be null (both in form and in JXMacroHelper) and thus the NPE.
> Sniffing the http traffic showed me that while in javascript the submission of the first form causes a <bu:continue/> and a new non-ajax request from the browser, while with javaflow this does not happen.
> Seems like the lines from 176 to 201 of /cocoon-2.1.X/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/Form.js were not ported to the javaflow FormInstance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (COCOON-1812) Javaflow and Ajax when sending two forms one after eachother

Posted by "Ugo Cei (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/COCOON-1812?page=all ]
     
Ugo Cei closed COCOON-1812:
---------------------------

    Fix Version: 2.1.9-dev (current SVN)
     Resolution: Fixed

Patch applied.

> Javaflow and Ajax when sending two forms one after eachother
> ------------------------------------------------------------
>
>          Key: COCOON-1812
>          URL: http://issues.apache.org/jira/browse/COCOON-1812
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms, Blocks: Java Flow
>     Versions: 2.1.9-dev (current SVN)
>     Reporter: Simone Gianni
>     Priority: Critical
>      Fix For: 2.1.9-dev (current SVN)
>  Attachments: javaflow-ajax.diff
>
> In javaflow, if I try to send an ajax form and then send another ajax form I obtain a NPE originating from JXMacroHelper.
> For example :
>   FormInstance fi = new FormInstance("myform.def.xml");
>   fi.show("mypipe");
>   fi = new FormInstance("myotherform.def.xml");
>   fi.show("myotherpipe");
> I receive an NPE originating from JXMacroHelper:162  while showing the second forms.
> After investigations i noticed that the second form was displayed following the ajax behaviour, while this second form is new and should not be "ajaxed". This causes the updatedWidgets list to be null (both in form and in JXMacroHelper) and thus the NPE.
> Sniffing the http traffic showed me that while in javascript the submission of the first form causes a <bu:continue/> and a new non-ajax request from the browser, while with javaflow this does not happen.
> Seems like the lines from 176 to 201 of /cocoon-2.1.X/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/Form.js were not ported to the javaflow FormInstance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1812) Javaflow and Ajax when sending two forms one after eachother

Posted by "Simone Gianni (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1812?page=comments#action_12371778 ] 

Simone Gianni commented on COCOON-1812:
---------------------------------------

I can try to port them, but after writing in the response the javascript flow terminates and waits for the new http request to arrive. How do i do this in javaflow? Continuation.suspend() (creating a continuation that will wait for nothing)?

The other way would be to throw an exception, but while this exception would go unnoticed under tomcat and jetty, it will appear under BEA, WebSphere and other containers.

I'll try suspending the continuation.

> Javaflow and Ajax when sending two forms one after eachother
> ------------------------------------------------------------
>
>          Key: COCOON-1812
>          URL: http://issues.apache.org/jira/browse/COCOON-1812
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms, Blocks: Java Flow
>     Versions: 2.1.9-dev (current SVN)
>     Reporter: Simone Gianni
>     Priority: Critical

>
> In javaflow, if I try to send an ajax form and then send another ajax form I obtain a NPE originating from JXMacroHelper.
> For example :
>   FormInstance fi = new FormInstance("myform.def.xml");
>   fi.show("mypipe");
>   fi = new FormInstance("myotherform.def.xml");
>   fi.show("myotherpipe");
> I receive an NPE originating from JXMacroHelper:162  while showing the second forms.
> After investigations i noticed that the second form was displayed following the ajax behaviour, while this second form is new and should not be "ajaxed". This causes the updatedWidgets list to be null (both in form and in JXMacroHelper) and thus the NPE.
> Sniffing the http traffic showed me that while in javascript the submission of the first form causes a <bu:continue/> and a new non-ajax request from the browser, while with javaflow this does not happen.
> Seems like the lines from 176 to 201 of /cocoon-2.1.X/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/Form.js were not ported to the javaflow FormInstance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1812) Javaflow and Ajax when sending two forms one after eachother

Posted by "Simone Gianni (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1812?page=comments#action_12371926 ] 

Simone Gianni commented on COCOON-1812:
---------------------------------------

Fixed this, now it works this way :

- The form is sent
- Once the form is complete and correct, a bu:continue is sent
... Please note that i ported the js code, but had to use redirector.setStatus to avoid CallFunctionNode exception
- The continuation is suspended, and will never regain control.
- The client calls the next continuation, sending a cocoon-ajax-continue=true
- This reenters the show method, so it first checks if cocoon-ajax-continue is present and in that case simply exits the loop.

> Javaflow and Ajax when sending two forms one after eachother
> ------------------------------------------------------------
>
>          Key: COCOON-1812
>          URL: http://issues.apache.org/jira/browse/COCOON-1812
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms, Blocks: Java Flow
>     Versions: 2.1.9-dev (current SVN)
>     Reporter: Simone Gianni
>     Priority: Critical

>
> In javaflow, if I try to send an ajax form and then send another ajax form I obtain a NPE originating from JXMacroHelper.
> For example :
>   FormInstance fi = new FormInstance("myform.def.xml");
>   fi.show("mypipe");
>   fi = new FormInstance("myotherform.def.xml");
>   fi.show("myotherpipe");
> I receive an NPE originating from JXMacroHelper:162  while showing the second forms.
> After investigations i noticed that the second form was displayed following the ajax behaviour, while this second form is new and should not be "ajaxed". This causes the updatedWidgets list to be null (both in form and in JXMacroHelper) and thus the NPE.
> Sniffing the http traffic showed me that while in javascript the submission of the first form causes a <bu:continue/> and a new non-ajax request from the browser, while with javaflow this does not happen.
> Seems like the lines from 176 to 201 of /cocoon-2.1.X/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/Form.js were not ported to the javaflow FormInstance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira