return (RequestDispatcher)AccessController.doPrivileged(dp);
}
// The remaining code is duplicated in PrivilegedGetRequestDispatcher,
// we need to make sure they stay in sync
HttpRequestBase request = new HttpRequestBase();
request.setContext(context);
request.setContextPath(context.getPath());
request.setRequestURI(contextPath + relativeURI);
request.setQueryString(queryString);
Wrapper wrapper = (Wrapper) context.map(request, true);
if (wrapper == null)
return (null);
// Construct a RequestDispatcher to process this request
HttpServletRequest hrequest =
(HttpServletRequest) request.getRequest();
return (RequestDispatcher) new ApplicationDispatcher(wrapper,
hrequest.getServletPath(),
hrequest.getPathInfo(),
hrequest.getQueryString(),
null);