// create wrapper for request and response
RenderServletRequestWrapper req = new RenderServletRequestWrapper(this.getrequest(), url);
RenderServletResponseWrapper res = new RenderServletResponseWrapper(this.getresponse());
**/
RenderServletRequest req = new RenderServletRequest(this.getrequest(), url);
RenderServletResponse res = new RenderServletResponse(this.getresponse());
// call include
this.getrequest().getRequestDispatcher(url).include(req, res);
// process response
if (res.isBinary()) {
byte data[] = res.getBinaryData();
return createDataURL(data, contentType);
} else {
String data = res.getStringData();
return createDataURL(data, contentType);
}
}