@Override
protected AbstractMvcView createMvcView(View view, RequestContext context) {
final ExternalContext externalContext = context.getExternalContext();
final Object nativeRequest = externalContext.getNativeRequest();
if (nativeRequest instanceof PortletRequest) {
return new PortletMvcView(view, context);
}
return new ServletMvcView(view, context);
}