Details
-
Bug
-
Status: Open
-
Critical
-
Resolution: Unresolved
-
2.2
-
None
-
None
-
Patch available
Description
If you do a redirect (from within a piece of flowscript "cocoon.redirectTo('cocoon:/foobar')" or via redirect-to in the sitemap) inside a block that was called via the block: protocol will fail since the re-use of the outputstream of the response (which happens to be a BlockCallHttpServletResponse) does not work.
This is due to the use of getWriter() after getOutputStream() has already been called. The servlet api says that only one of them should be called, so there is a check in the implementation of getWriter() that will throw an IllegalStateException. The patch removes that check, which is kinda hack, but I don't know of any other cases within cocoon where such a re-use is made.
The problem could be avoided if during the redirect a reset() or resetBuffer() would be called on the response, but for some reason this does not happen with a redirect from within a flowscript for a form.
This is due to the use of getWriter() after getOutputStream() has already been called. The servlet api says that only one of them should be called, so there is a check in the implementation of getWriter() that will throw an IllegalStateException. The patch removes that check, which is kinda hack, but I don't know of any other cases within cocoon where such a re-use is made.
The problem could be avoided if during the redirect a reset() or resetBuffer() would be called on the response, but for some reason this does not happen with a redirect from within a flowscript for a form.
Attachments
Attachments
Issue Links
- is related to
-
COCOON-1963 Add a redirect action to the browser update handler
- Open