empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r1348155 - in /empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2: app/FacesUtils.java pages/PageDefinition.java
Date Fri, 08 Jun 2012 17:11:16 GMT
Author: doebele
Date: Fri Jun  8 17:11:15 2012
New Revision: 1348155

URL: http://svn.apache.org/viewvc?rev=1348155&view=rev
Log:
EMPIREDB-140
bugfix in PageOutcome

Modified:
    empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/FacesUtils.java
    empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pages/PageDefinition.java

Modified: empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/FacesUtils.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/FacesUtils.java?rev=1348155&r1=1348154&r2=1348155&view=diff
==============================================================================
--- empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/FacesUtils.java
(original)
+++ empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/app/FacesUtils.java
Fri Jun  8 17:11:15 2012
@@ -35,6 +35,7 @@ import javax.servlet.http.HttpServletReq
 import org.apache.empire.db.DBDatabase;
 import org.apache.empire.jsf2.pages.Page;
 import org.apache.empire.jsf2.pages.PageDefinition;
+import org.apache.empire.jsf2.pages.PageOutcome;
 import org.apache.empire.jsf2.utils.ParameterMap;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -86,7 +87,10 @@ public class FacesUtils
     public static void redirectDirectly(final FacesContext fc, final String url)
     {
         try
-        {
+        {   // log
+            if (log.isDebugEnabled())
+                log.debug("Redirecting directly to {}.", url);
+            // redirectDirectly
             fc.getExternalContext().redirect(url);
             fc.responseComplete();
         }
@@ -96,12 +100,17 @@ public class FacesUtils
         }
     }
 
-    public static void redirectDirectly(final FacesContext fc, final PageDefinition page)
+    public static void redirectDirectly(final FacesContext fc, final PageOutcome outcome)
     {
         String ctxPath = fc.getExternalContext().getRequestContextPath();
-        String pageURI = ctxPath + page.getPath().replace(".xhtml", ".iface");
+        String pageURI = ctxPath + outcome.toString();
         FacesUtils.redirectDirectly(fc, pageURI);
     }
+
+    public static void redirectDirectly(final FacesContext fc, final PageDefinition page)
+    {
+        FacesUtils.redirectDirectly(fc, page.getOutcome());
+    }
     
     /* Connection */
     

Modified: empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pages/PageDefinition.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pages/PageDefinition.java?rev=1348155&r1=1348154&r2=1348155&view=diff
==============================================================================
--- empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pages/PageDefinition.java
(original)
+++ empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pages/PageDefinition.java
Fri Jun  8 17:11:15 2012
@@ -118,7 +118,7 @@ public class PageDefinition
     
     public PageOutcome getOutcome()
     {
-        return new PageOutcome(path);
+        return new PageOutcome(path.replace(".xhtml", ".iface"));
     }
     
     public PageOutcome getOutcome(String action)



Mime
View raw message