package org.seasar.jsf.jsp;

import java.io.PrintWriter;

import javax.servlet.ServletOutputStream;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
import javax.servlet.jsp.JspWriter;

public class ServletResponseWrapperInclude extends HttpServletResponseWrapper {
	
	private PrintWriter writer;

	public ServletResponseWrapperInclude(ServletResponse response,
			JspWriter jspWriter) {

		super((HttpServletResponse) response);
		this.writer = new PrintWriter(jspWriter);
	}

	/**
	 * Returns a wrapper around the JspWriter of the including page.
	 */
	public java.io.PrintWriter getWriter() throws java.io.IOException {
		return writer;
	}

	public ServletOutputStream getOutputStream() throws java.io.IOException {
		throw new IllegalStateException();
	}
}