if (wrappedServletResponse instanceof BridgeAfterViewContentResponse) {
BridgeAfterViewContentResponse bridgeAfterViewContentPreResponse = (BridgeAfterViewContentResponse)
wrappedServletResponse;
PortletResponse wrappedPortletResponse = bridgeAfterViewContentPreResponse.getWrapped();
BridgeWriteBehindSupportFactory bridgeWriteBehindSupportFactory = (BridgeWriteBehindSupportFactory)
FactoryExtensionFinder.getFactory(BridgeWriteBehindSupportFactory.class);
BridgeWriteBehindResponse bridgeWriteBehindResponse =
bridgeWriteBehindSupportFactory.getBridgeWriteBehindResponse((MimeResponse)
wrappedPortletResponse, facesImplementationServletResponse);
// Note: See comments in BridgeContextImpl#dispatch(String) regarding Liferay's inability to
// accept a wrapped response. This is indeed supported in Pluto.
this.portletResponse = (PortletResponse) bridgeWriteBehindResponse;