Example usage for javax.servlet ServletResponseWrapper getResponse

List of usage examples for javax.servlet ServletResponseWrapper getResponse

Introduction

In this page you can find the example usage for javax.servlet ServletResponseWrapper getResponse.

Prototype


public ServletResponse getResponse() 

Source Link

Document

Return the wrapped ServletResponse object.

Usage

From source file:net.lightbody.bmp.proxy.jetty.jetty.servlet.ServletHttpResponse.java

/** Unwrap a ServletResponse.
 *
 * @see javax.servlet.ServletResponseWrapper
 * @see javax.servlet.http.HttpServletResponseWrapper
 * @param response /* w w  w  . ja v  a2 s. c  o  m*/
 * @return The core ServletHttpResponse which must be the
 * underlying response object 
 */
public static ServletHttpResponse unwrap(ServletResponse response) {
    while (!(response instanceof ServletHttpResponse)) {
        if (response instanceof ServletResponseWrapper) {
            ServletResponseWrapper wrapper = (ServletResponseWrapper) response;
            response = wrapper.getResponse();
        } else
            throw new IllegalArgumentException("Does not wrap ServletHttpResponse");
    }

    return (ServletHttpResponse) response;
}