// forward the response
if (restResponse instanceof Status) {
Status status = (Status) restResponse;
StatusCodeCollector.setStatusCode(status.getStatus());
} else if (restResponse instanceof Page) {
Page page = (Page) restResponse;
ControllerContextHelper.storeContext(page.getData(), inputParameters);
URL pageUri = new URL(new URL("servlet:"), page.getUri());
URLConnection servletConnection = pageUri.openConnection();
IOUtils.copy(servletConnection.getInputStream(), outputStream);
URLConnectionUtils.closeQuietly(servletConnection);
}
} catch (Exception e) {