// If the URL contains the "javax.portlet.faces.PortletMode" parameter, then set the
// PortletMode on the ActionResponse.
if (Bridge.PORTLET_MODE_PARAMETER.equals(urlParameterName)) {
PortletMode portletMode = new PortletMode(parameterValue);
BridgeRequestScope bridgeRequestScope = bridgeContext.getBridgeRequestScope();
if (bridgeRequestScope != null) {
PortletRequest portletRequest = bridgeContext.getPortletRequest();
if (!portletRequest.getPortletMode().equals(portletMode) &&
portletRequest.isPortletModeAllowed(portletMode)) {
stateAwareResponse.setPortletMode(portletMode);
bridgeRequestScope.setPortletModeChanged(true);
}
}
}
// Otherwise, if the URL contains the "javax.portlet.faces.WindowState" parameter, then