You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Adam Winer (JIRA)" <in...@incubator.apache.org> on 2005/03/30 01:00:22 UTC

[jira] Created: (MYFACES-152) ResponseWriter.endDocument() abuse breaks ADF Faces

ResponseWriter.endDocument() abuse breaks ADF Faces
---------------------------------------------------

         Key: MYFACES-152
         URL: http://issues.apache.org/jira/browse/MYFACES-152
     Project: MyFaces
        Type: Bug
    Versions: 1.0.9 beta    
    Reporter: Adam Winer
    Priority: Critical


I've been shown some problems lately with MyFaces 1.0.9 and ADF Faces.
The problems specifically trace to MyFaces's use of
ResponseWriter.endDocument() to output Javascript.  Since ADF Faces
runs with its own RenderKit (and therefore its own ResponseWriter),
this Javascript is getting dropped and not written.

I'd recommend (both as JSF EG guy and ADF Faces guy) that this MyFaces
code be moved *out* of ResponseWriter.endDocument().  Specifically:

- ResponseWriter.endDocument() is not guaranteed to be called before
the close of <body> or even the close of <html>, and therefore this
script cannot be safely output at this point.  It's quite likely that
changes in JSF 1.2 will essentially guarantee that endDocument() is
not called until the close of all output.
- This is not really the intent of ResponseWriter.endDocument().  In
HTML, it should be a no-op.  It's there for more bizarre scenarios
like a ResponseWriter outputting a SOAP envelope around a response.
- It's breaking ADF Faces. :)

A significantly cleaner way to output needed Javascript is to add it
as needed from the Renderers that require it (using a request-scoped
attribute to track if its been added already).


-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-152) ResponseWriter.endDocument() abuse breaks ADF Faces

Posted by "Kalle Korhonen (JIRA)" <in...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-152?page=comments#action_61975 ]
     
Kalle Korhonen commented on MYFACES-152:
----------------------------------------

I don't know too much about this, so ignore if I'm way off. But couldn't we add the dummyForm and Javascripts for auto-scroll etc. in the ExtensionsFilter as a "decoration" to the response, more or less the same way SiteMesh is doing its stuff? Auto-scroll is not a required functionality and a commandLink only breaks if it's not enclosed in a form.

> ResponseWriter.endDocument() abuse breaks ADF Faces
> ---------------------------------------------------
>
>          Key: MYFACES-152
>          URL: http://issues.apache.org/jira/browse/MYFACES-152
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>     Reporter: Adam Winer
>     Priority: Critical

>
> I've been shown some problems lately with MyFaces 1.0.9 and ADF Faces.
> The problems specifically trace to MyFaces's use of
> ResponseWriter.endDocument() to output Javascript.  Since ADF Faces
> runs with its own RenderKit (and therefore its own ResponseWriter),
> this Javascript is getting dropped and not written.
> I'd recommend (both as JSF EG guy and ADF Faces guy) that this MyFaces
> code be moved *out* of ResponseWriter.endDocument().  Specifically:
> - ResponseWriter.endDocument() is not guaranteed to be called before
> the close of <body> or even the close of <html>, and therefore this
> script cannot be safely output at this point.  It's quite likely that
> changes in JSF 1.2 will essentially guarantee that endDocument() is
> not called until the close of all output.
> - This is not really the intent of ResponseWriter.endDocument().  In
> HTML, it should be a no-op.  It's there for more bizarre scenarios
> like a ResponseWriter outputting a SOAP envelope around a response.
> - It's breaking ADF Faces. :)
> A significantly cleaner way to output needed Javascript is to add it
> as needed from the Renderers that require it (using a request-scoped
> attribute to track if its been added already).

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-152) ResponseWriter.endDocument() abuse breaks ADF Faces

Posted by "Manfred Geiler (JIRA)" <in...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-152?page=comments#action_61924 ]
     
Manfred Geiler commented on MYFACES-152:
----------------------------------------

We cannot output the dummyForm javascript at once, because first the needed dummy request parameters have to be collected. The javascript must be rendered at the end of the page.
The same applies to the autoscroll feature. What, if you have a page without MyFaces components? Who should render the necessary script? IMHO, this can only be done by the ResponseWriter. And since these things are all custom RenderKit features, it must be done by out special ResponseWriter!

The endDocument() method is in fact not the proper place for this kind of things, you are right. An alternative would be to parse the written stream on the fly for the </body> ot </html> String an insert the script output there.


> ResponseWriter.endDocument() abuse breaks ADF Faces
> ---------------------------------------------------
>
>          Key: MYFACES-152
>          URL: http://issues.apache.org/jira/browse/MYFACES-152
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>     Reporter: Adam Winer
>     Priority: Critical

>
> I've been shown some problems lately with MyFaces 1.0.9 and ADF Faces.
> The problems specifically trace to MyFaces's use of
> ResponseWriter.endDocument() to output Javascript.  Since ADF Faces
> runs with its own RenderKit (and therefore its own ResponseWriter),
> this Javascript is getting dropped and not written.
> I'd recommend (both as JSF EG guy and ADF Faces guy) that this MyFaces
> code be moved *out* of ResponseWriter.endDocument().  Specifically:
> - ResponseWriter.endDocument() is not guaranteed to be called before
> the close of <body> or even the close of <html>, and therefore this
> script cannot be safely output at this point.  It's quite likely that
> changes in JSF 1.2 will essentially guarantee that endDocument() is
> not called until the close of all output.
> - This is not really the intent of ResponseWriter.endDocument().  In
> HTML, it should be a no-op.  It's there for more bizarre scenarios
> like a ResponseWriter outputting a SOAP envelope around a response.
> - It's breaking ADF Faces. :)
> A significantly cleaner way to output needed Javascript is to add it
> as needed from the Renderers that require it (using a request-scoped
> attribute to track if its been added already).

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira