You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Max Starets (JIRA)" <de...@myfaces.apache.org> on 2010/05/27 23:05:38 UTC

[jira] Created: (TRINIDAD-1817) fileDownloadActionListeners needs to delay retrieving OutputStream from the response until something needs to be written to the stream

fileDownloadActionListeners needs to delay retrieving OutputStream from the response until something needs to be written to the stream
--------------------------------------------------------------------------------------------------------------------------------------

                 Key: TRINIDAD-1817
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1817
             Project: MyFaces Trinidad
          Issue Type: Bug
    Affects Versions: 2.0.0.3-core
            Reporter: Max Starets
            Assignee: Max Starets


The issue may be demonstrated by taking our fileDownloadActionListener demo and modifying it to run with Facelets.
After you click on the 'Click for Error" button, you will get an UnsupportedOperationException instead of the expected FacesMessage.
The exception is thrown because we calling getOutputStream(), but not completing the response when we want to report an error.
JSF later calls getWriter(), which is causing UnsupportedOperationException.

This problem does not show up with JSPs because of the side effect of the JSP engine dispatch - getWriter() simply succeeds.

The solution is to create a proxy OutputStream that retrieves the delegate stream only when it needs to write.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TRINIDAD-1817) fileDownloadActionListeners needs to delay retrieving OutputStream from the response until something needs to be written to the stream

Posted by "Max Starets (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TRINIDAD-1817?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Max Starets updated TRINIDAD-1817:
----------------------------------

    Status: Patch Available  (was: Open)

> fileDownloadActionListeners needs to delay retrieving OutputStream from the response until something needs to be written to the stream
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-1817
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1817
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions: 2.0.0.3-core
>            Reporter: Max Starets
>            Assignee: Max Starets
>         Attachments: trinidad-1817.patch
>
>
> The issue may be demonstrated by taking our fileDownloadActionListener demo and modifying it to run with Facelets.
> After you click on the 'Click for Error" button, you will get an UnsupportedOperationException instead of the expected FacesMessage.
> The exception is thrown because we calling getOutputStream(), but not completing the response when we want to report an error.
> JSF later calls getWriter(), which is causing UnsupportedOperationException.
> This problem does not show up with JSPs because of the side effect of the JSP engine dispatch - getWriter() simply succeeds.
> The solution is to create a proxy OutputStream that retrieves the delegate stream only when it needs to write.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TRINIDAD-1817) fileDownloadActionListeners needs to delay retrieving OutputStream from the response until something needs to be written to the stream

Posted by "Max Starets (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TRINIDAD-1817?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Max Starets updated TRINIDAD-1817:
----------------------------------

        Status: Resolved  (was: Patch Available)
    Resolution: Fixed

Committed rev.  949196

> fileDownloadActionListeners needs to delay retrieving OutputStream from the response until something needs to be written to the stream
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-1817
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1817
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions: 2.0.0.3-core
>            Reporter: Max Starets
>            Assignee: Max Starets
>         Attachments: trinidad-1817.patch
>
>
> The issue may be demonstrated by taking our fileDownloadActionListener demo and modifying it to run with Facelets.
> After you click on the 'Click for Error" button, you will get an UnsupportedOperationException instead of the expected FacesMessage.
> The exception is thrown because we calling getOutputStream(), but not completing the response when we want to report an error.
> JSF later calls getWriter(), which is causing UnsupportedOperationException.
> This problem does not show up with JSPs because of the side effect of the JSP engine dispatch - getWriter() simply succeeds.
> The solution is to create a proxy OutputStream that retrieves the delegate stream only when it needs to write.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.