myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject svn commit: r1480930 - /myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/servlet/NonFacesRequestServlet.java
Date Fri, 10 May 2013 08:26:57 GMT
Author: weber
Date: Fri May 10 08:26:57 2013
New Revision: 1480930

URL: http://svn.apache.org/r1480930
Log:
TOBAGO-1267 - NonFacesRequestServlet: allow subclasses to create own ViewRoot

Modified:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/servlet/NonFacesRequestServlet.java

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/servlet/NonFacesRequestServlet.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/servlet/NonFacesRequestServlet.java?rev=1480930&r1=1480929&r2=1480930&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/servlet/NonFacesRequestServlet.java
(original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/servlet/NonFacesRequestServlet.java
Fri May 10 08:26:57 2013
@@ -25,7 +25,6 @@ import org.slf4j.LoggerFactory;
 import javax.faces.FactoryFinder;
 import javax.faces.application.Application;
 import javax.faces.application.NavigationHandler;
-import javax.faces.application.ViewHandler;
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
 import javax.faces.context.FacesContextFactory;
@@ -65,10 +64,7 @@ public abstract class NonFacesRequestSer
 
       Application application = facesContext.getApplication();
       if (facesContext.getViewRoot() == null) {
-        ViewHandler viewHandler = application.getViewHandler();
-        String viewId = getFromViewId();
-        UIViewRoot view = viewHandler.createView(facesContext, viewId);
-        facesContext.setViewRoot(view);
+        facesContext.setViewRoot(createViewRoot(facesContext));
       }
 
       NavigationHandler navigationHandler = application.getNavigationHandler();
@@ -81,6 +77,10 @@ public abstract class NonFacesRequestSer
     }
   }
 
+  protected UIViewRoot createViewRoot(FacesContext facesContext) {
+    return facesContext.getApplication().getViewHandler().createView(facesContext, getFromViewId());
+  }
+
   public abstract String invokeApplication(FacesContext facesContext);
 
   /**



Mime
View raw message