}
}
else if (controllerResponse instanceof ResourceResponse)
{
ResourceResponse resourceResponse = (ResourceResponse)controllerResponse;
PortletInvocationResponse pir = resourceResponse.getResponse();
//
if (pir instanceof ContentResponse)
{
ContentResponse contentResponse = (ContentResponse)pir;
//
if (contentResponse.getType() == ContentResponse.TYPE_EMPTY)
{
resp.setStatus(HttpServletResponse.SC_NO_CONTENT);
}
else
{
String contentType = contentResponse.getContentType();
if (contentType != null)
{
resp.setContentType(contentType);
}
//
if (contentResponse.getType() == ContentResponse.TYPE_BYTES)
{
ServletOutputStream out = null;
try
{
out = resp.getOutputStream();
out.write(contentResponse.getBytes());
}
finally
{
IOTools.safeClose(out);
}
}
else
{
Writer writer = null;
try
{
writer = resp.getWriter();
writer.write(contentResponse.getChars());
}
finally
{
writer.close();
}
}
}
}
else
{
// todo
}
//
return;
}
else if (controllerResponse instanceof PortletResponse)
{
PortletResponse portletResponse = (PortletResponse)controllerResponse;
PortletInvocationResponse pir = portletResponse.getResponse();
//
if (pir instanceof ErrorResponse)
{
ErrorResponse errorResponse = (ErrorResponse)pir;