call to response.getOutputStream() during the rendering process fails
---------------------------------------------------------------------

                 Key: MAGNOLIA-3014
                 URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-3014
             Project: Magnolia
          Issue Type: Bug
    Affects Versions: 4.2
            Reporter: Philipp Bärfuss
            Assignee: Boris Kraft
             Fix For: 4.3


After the refactoring of the renderers in 4.0 we pass now the writer directly 
to the renderer. Which is done by calling response.getWriter(). This is very 
useful as this makes the rendering in general independent of the servlet API 
and allows direct calls to the rendering engine by Java code (for instance 
servlets or tests).

Unfortunately a later call to response.getOutputStream() will fail as this 
violates the Servlet API specifications. There are several solutions possible.

Workaround: registering your custom servlet (at the servlets filter) and let 
the request be rendered by the servlet and not by the rendering filter

A) Pass a lazy wrapper instead of  the writer
instead of passing the writer we pass a lazy wrapper which will call 
response.getWriter() only once the first operation is performed on the writer
- not very transparent
+ no changes in the API needed

B) Change the API
Support both variations of renderers. This can be achieved by various ways
B.1) pass a object (magnolia response?) providing both methods which delegate 
to the response
B.2) have two methods render(.., writer) and render(.. stream) (most likely by 
having two interfaces) 




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



----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <dev-list-unsubscr...@magnolia-cms.com>
----------------------------------------------------------------

Reply via email to