FacesContext.getResponseStream/getResponseWriter unimplemented
--------------------------------------------------------------

         Key: MYFACES-605
         URL: http://issues.apache.org/jira/browse/MYFACES-605
     Project: MyFaces
        Type: Bug
  Components: Implementation  
    Versions: Nightly Build    
    Reporter: Mike Kienenberger


I'm trying to generate a downloadable file link, and I'm using:

        FacesContext facesContext = FacesContext.getCurrentInstance();
        OutputStream responseStream = facesContext.getResponseStream();

but responseStream is coming back null.

A search through the code seems to indicate that the only thing to call 
ServletFacesContextImpl.setResponseStream is 
FacesContextWrapper.setResponseStream(), and nothing calls this method.

The same thing appears to be true for responseWriter.

It looks like these methods should be delegating to the ExternalContext rather 
than holding local copies of the values, especially since the external context 
has valid references.

facesContext= ServletFacesContextImpl  (id=117)
        _externalContext= ServletExternalContextImpl  (id=122)
                _servletResponse= ExtensionsResponseWrapper  (id=157)
                        printWriter= null
                        response= ServletHttpResponse  (id=165)
                        stream= ByteArrayOutputStream  (id=167)
        _renderResponse= false
        _responseComplete= false
        _responseStream= null
        _responseWriter= null

However, I'm not sure the best way of doing this.   One way would be to 
typecast ExternalContext to either a ServletExternalContextImpl or a 
PortletExternalContextImpl and follow the chain of objects.

I can create a patch to do this if there's confirmation that this is the best 
way to go about it.


-- 
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

Reply via email to