Example usage for javax.servlet ServletRequestWrapper getRequest

List of usage examples for javax.servlet ServletRequestWrapper getRequest

Introduction

In this page you can find the example usage for javax.servlet ServletRequestWrapper getRequest.

Prototype

public ServletRequest getRequest() 

Source Link

Document

Return the wrapped request object.

Usage

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

/** Unwrap a ServletRequest.
 *
 * @see javax.servlet.ServletRequestWrapper
 * @see javax.servlet.http.HttpServletRequestWrapper
 * @param request /*  w ww.  ja va 2 s .c  o m*/
 * @return The core ServletHttpRequest which must be the
 * underlying request object 
 */
public static ServletHttpRequest unwrap(ServletRequest request) {
    while (!(request instanceof ServletHttpRequest)) {
        if (request instanceof ServletRequestWrapper) {
            ServletRequestWrapper wrapper = (ServletRequestWrapper) request;
            request = wrapper.getRequest();
        } else
            throw new IllegalArgumentException("Does not wrap ServletHttpRequest");
    }

    return (ServletHttpRequest) request;
}