}
protected void doRender(Map<String, ?> model) throws Exception {
RequestContext context = getRequestContext();
ExternalContext externalContext = context.getExternalContext();
View view = getView();
PortletContext portletContext = (PortletContext) externalContext.getNativeContext();
PortletRequest request = (PortletRequest) externalContext.getNativeRequest();
MimeResponse response = (MimeResponse) externalContext.getNativeResponse();
if (response.getContentType() == null) {
// No Portlet content type specified yet -> use the view-determined type.
// (The Portlet spec requires the content type to be set on the RenderResponse)
String contentType = view.getContentType();
if (contentType != null) {
response.setContentType(contentType);
}
}
request.setAttribute(ViewRendererServlet.VIEW_ATTRIBUTE, view);