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 2015/04/23 15:53:50 UTC

svn commit: r1675616 - in /myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main: java/org/apache/myfaces/tobago/example/demo/MultiplePageDeclarationLanguageNavigationHandler.java webapp/WEB-INF/web.xml

Author: lofwyr
Date: Thu Apr 23 13:53:50 2015
New Revision: 1675616

URL: http://svn.apache.org/r1675616
Log:
document prefix vs. suffix mapping

Modified:
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/MultiplePageDeclarationLanguageNavigationHandler.java
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml

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=1675616&r1=1675615&r2=1675616&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 Thu Apr 23 13:53:50 2015
@@ -81,9 +81,14 @@ public class MultiplePageDeclarationLang
       facesContext.setViewRoot(viewRoot);
       final ExternalContext externalContext = facesContext.getExternalContext();
       try {
+        final String baseUrl = externalContext.getRequestContextPath() + "/faces" + outcome;
+/*
+        Change this, when changing the <url-pattern> in web.xml
+        final String baseUrl = externalContext.getRequestContextPath() + outcome.replaceAll("xhtml", "jsf");
+*/
         externalContext.redirect(
-            externalContext.encodeRedirectURL(externalContext.getRequestContextPath() + "/faces" + outcome,
-            Collections.<String, List<String>>emptyMap()));
+            externalContext.encodeRedirectURL(baseUrl, Collections.<String, List<String>>emptyMap()));
+
       } catch (final IOException e) {
         // not nice?
         facesContext.renderResponse();

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml?rev=1675616&r1=1675615&r2=1675616&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml Thu Apr 23 13:53:50 2015
@@ -139,6 +139,8 @@
   <servlet-mapping>
     <servlet-name>FacesServlet</servlet-name>
     <url-pattern>/faces/*</url-pattern>
+    <!-- if changing this, also change MultiplePageDeclarationLanguageNavigationHandler -->
+    <!-- <url-pattern>*.jsf</url-pattern> -->
   </servlet-mapping>
 
   <!-- ResourceServlet -->