class HttpRequestWrapper extends HttpServletRequestWrapper implements RequestWithSession {

  public HttpRequestWrapper(HttpServletRequest req, ServletContext servletContext) {
    super(req);
    this.servletContext = servletContext;
    manager = (SessionManager)servletContext.getAttribute(Attributes.SESSION_MANAGER);
    ServletRequest originalRequest = req;
    while (originalRequest instanceof ServletRequestWrapper) {
      if (originalRequest instanceof HttpRequestWrapper) {
        break;
      }
      originalRequest = ((ServletRequestWrapper)originalRequest).getRequest();
    }

    embeddedRequest = (originalRequest instanceof HttpRequestWrapper) ? (HttpRequestWrapper)originalRequest : null;
  }

  public  HttpRequestWrapper(HttpServletRequest req, ServletContext servletContext);

}