PortalServletResponse portalResponse = new JahiaPortalServletResponse(httpServletResponse);
// Render the portlet and cache the response.
try {
Map<String, Object> map = JahiaPortletUtil.filterJahiaAttributes(portalRequest);
container.doRender(window, portalRequest, portalResponse);
JahiaPortletUtil.setJahiaAttributes(portalRequest, map);
} catch (Exception th) {
logger.error("Error while rendering portlet", th);
}
final String portletRendering = portalResponse.getInternalBuffer().getBuffer().toString();