Code example for StringWriter

Methods: getBuffer

	public String getBufferedResponse() {
		String bufferedResponse = null;
		if (stringWriter != null) {
			bufferedResponse = stringWriter.getBuffer().toString();
		return bufferedResponse;
	public void setContentType(String type) {
		// NOTE: This method is deliberately overridden and does nothing. If not overridden, then in the case of Ajax, 
		// the JSP engine would end up setting the content-type of the HttpServletResponse to something other than 
		// text/xml which causes the DOM replacements to fail in the browser. 
	public PrintWriter getWriter() throws IOException {