Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 340927

Summary: Cleanup and refactor HtmlResponseWriter
Product: [RT] RAP Reporter: Ralf Sternberg <rsternberg>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: ruediger.herrmann, stephan.leichtvogt
Version: 1.4   
Target Milestone: 1.4 M7   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 311355    

Description Ralf Sternberg CLA 2011-03-24 21:34:59 EDT
The class HtmlResponseWriter has been designed to assemble an HTML page. Actually, it is now being used only to render JavaScript responses. It contains a number of unused methods and is not streaming-capable. After cleaning up and renaming this class, it should be possible to pipe the rendered strings directly to a wrapped writer (the servlet's writer). This would simplify connecting the new protocol writer (bug 311355).
Comment 1 Ralf Sternberg CLA 2011-03-30 18:30:24 EDT
Removed all unneeded methods from class HtmlResponseWriter and renamed it to JavaScriptResponseWriter to reflect its only current purpose. It should now be easy to change it to direct streaming mode. However, this should be done together with the protocol changes.
Changes are in CVS HEAD.
Comment 2 Stephan Leicht Vogt CLA 2011-04-06 03:09:55 EDT
Why do the write-methods throw an IOException? None of the called methods in those write-methods do throw an IOException?
Comment 3 RĂ¼diger Herrmann CLA 2011-04-06 04:55:07 EDT
The write method throw IOException for historical reasons (the HtmlResponseWriter was modeled after the JSF response writer).
However, I agree with you that these methods should no longer throw IOException.
Comment 4 RĂ¼diger Herrmann CLA 2011-04-11 07:12:00 EDT
As per 2011-04-11 the IOException is gone and the method set of the JavascriptResponseWriter is reduced to the necessary minimum.
Comment 5 Stephan Leicht Vogt CLA 2011-04-11 09:13:39 EDT
Thanks, looks good.