if (httpRequest instanceof SiteRequestWrapper) {
request = httpRequest;
response = httpResponse;
originalRequest = false;
} else if (httpRequest instanceof WebloungeRequest) {
request = new SiteRequestWrapper((WebloungeRequest) httpRequest, httpRequest.getPathInfo(), false);
response = httpResponse;
originalRequest = false;
} else {
WebloungeRequestImpl webloungeRequest = new WebloungeRequestImpl(httpRequest, environment);
webloungeRequest.init(site);
webloungeRequest.setUser(securityService.getUser());
String requestPath = UrlUtils.concat("/site", httpRequest.getPathInfo());
request = new SiteRequestWrapper(webloungeRequest, requestPath, false);
response = new WebloungeResponseImpl(httpResponse);
((WebloungeResponseImpl) response).setRequest(webloungeRequest);
}
// Make sure the resource exists, Jasper will not produce a meaningful error