if (servletPath == null) {
return "";
}
// original wrapper stream
JWebLiteResponseWrapper respWrapper = (JWebLiteResponseWrapper) resp;
JWebLiteResponseWrapperStream respWrapperStream = respWrapper
.getWrapperStream();
OutputStream originalOutputStream = respWrapperStream
.getOriginalOutputStream();
// proxy
ByteArrayOutputStream baos = new ByteArrayOutputStream();
respWrapperStream.setGZipEnabled(false);
respWrapperStream.resetOutputStream(baos);
req.getRequestDispatcher(servletPath).forward(req, resp);
// revert
respWrapperStream.setGZipEnabled(respWrapper.isGZipEnabled());
respWrapperStream.resetOutputStream(originalOutputStream);
return baos.toString();
}