logger.debug("fromAction=[{0}] outcome=[{1}]", fromAction, outcome);
NavigationCase navigationCase = getNavigationCase(facesContext, fromAction, outcome);
BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
// Ask the wrapped NavigationHandler to perform the navigation.
wrappedNavigationHandler.handleNavigation(facesContext, fromAction, outcome);
if (navigationCase != null) {
// Hack for http://jira.icesoft.org/browse/ICE-7996
Iterator<FacesMessage> itr = facesContext.getMessages();
while (itr.hasNext()) {
FacesMessage facesMessage = itr.next();
if (facesMessage.getDetail().contains("Unable to find matching navigation case")) {
logger.warn("Removed bogus FacesMessage caused by http://jira.icesoft.org/browse/ICE-7996");
itr.remove();
}
}
// If the navigation-case is NOT a redirect, then directly encode the {@link PortletMode} and {@link
// WindowState} to the response. Don't need to worry about the redirect case here because that's handled in
// the BridgeContext#redirect(String) method. It would be nice to handle the redirect case here but it needs
// to stay in BridgeContext#redirect(String) since it's possible for developers to call
// ExternalContext.redirect(String) directly from their application.
if (!navigationCase.isRedirect()) {
String toViewId = navigationCase.getToViewId(facesContext);
if (toViewId != null) {
PortletResponse portletResponse = bridgeContext.getPortletResponse();
if (portletResponse instanceof StateAwareResponse) {
BridgeActionURL bridgeActionURL = bridgeContext.encodeActionURL(toViewId);
try {
BridgeNavigationCase bridgeNavigationCase = new BridgeNavigationCaseImpl(navigationCase);
String portletMode = bridgeNavigationCase.getPortletMode();