You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2013/11/05 17:54:08 UTC
svn commit: r1539057 -
/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/MultiplePageDeclarationLanguageNavigationHandler.java
Author: lofwyr
Date: Tue Nov 5 16:54:08 2013
New Revision: 1539057
URL: http://svn.apache.org/r1539057
Log:
TOBAGO-1334: Client Dimension should support redirect tag in naviation rules
Modified:
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/MultiplePageDeclarationLanguageNavigationHandler.java
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/MultiplePageDeclarationLanguageNavigationHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/MultiplePageDeclarationLanguageNavigationHandler.java?rev=1539057&r1=1539056&r2=1539057&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/MultiplePageDeclarationLanguageNavigationHandler.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/MultiplePageDeclarationLanguageNavigationHandler.java Tue Nov 5 16:54:08 2013
@@ -28,7 +28,11 @@ import org.slf4j.LoggerFactory;
import javax.faces.application.NavigationHandler;
import javax.faces.application.ViewHandler;
import javax.faces.component.UIViewRoot;
+import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.List;
public class MultiplePageDeclarationLanguageNavigationHandler extends NavigationHandler {
@@ -73,7 +77,14 @@ public class MultiplePageDeclarationLang
ViewHandler viewHandler = facesContext.getApplication().getViewHandler();
UIViewRoot viewRoot = viewHandler.createView(facesContext, outcome);
facesContext.setViewRoot(viewRoot);
- facesContext.renderResponse();
+ final ExternalContext externalContext = facesContext.getExternalContext();
+ try {
+ externalContext.redirect(
+ externalContext.encodeRedirectURL("/faces" + outcome, Collections.<String, List<String>>emptyMap()));
+ } catch (IOException e) {
+ // not nice?
+ facesContext.renderResponse();
+ }
} else {
navigationHandler.handleNavigation(facesContext, fromAction, outcome);
}