myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bom...@apache.org
Subject svn commit: r813738 - /myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/servlet/NonFacesRequestServlet.java
Date Fri, 11 Sep 2009 09:25:52 GMT
Author: bommel
Date: Fri Sep 11 09:25:47 2009
New Revision: 813738

URL: http://svn.apache.org/viewvc?rev=813738&view=rev
Log:
(TOBAGO-794) FacesContext.release should called in NonFacesRequestServlet

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

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/servlet/NonFacesRequestServlet.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/servlet/NonFacesRequestServlet.java?rev=813738&r1=813737&r2=813738&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/servlet/NonFacesRequestServlet.java
(original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/servlet/NonFacesRequestServlet.java
Fri Sep 11 09:25:47 2009
@@ -52,29 +52,32 @@
     FacesContextFactory fcFactory = (FacesContextFactory)
         FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
     FacesContext facesContext =
-        fcFactory.getFacesContext(getServletContext(), request, response,
-            lifecycle);
-    Application application = facesContext.getApplication();
-    ViewHandler viewHandler = application.getViewHandler();
-    String viewId = getFromViewId();
-    UIViewRoot view = viewHandler.createView(facesContext, viewId);
-    facesContext.setViewRoot(view);
+        fcFactory.getFacesContext(getServletContext(), request, response, lifecycle);
+    try {
+      Application application = facesContext.getApplication();
+      ViewHandler viewHandler = application.getViewHandler();
+      String viewId = getFromViewId();
+      UIViewRoot view = viewHandler.createView(facesContext, viewId);
+      facesContext.setViewRoot(view);
 
 //    ExternalContext externalContext = facesContext.getExternalContext();
 //    externalContext.getRequestMap().put("com.sun.faces.INVOCATION_PATH", "/faces");
 
-    // invoke application
-    String outcome = invokeApplication(facesContext);
+      // invoke application
+      String outcome = invokeApplication(facesContext);
 
-    if (facesContext.getResponseComplete()) {
-      return;
+      if (facesContext.getResponseComplete()) {
+        return;
+      }
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("outcome = '" + outcome + "'");
+      }
+      NavigationHandler navigationHandler = application.getNavigationHandler();
+      navigationHandler.handleNavigation(facesContext, null, outcome);
+      lifecycle.render(facesContext);
+    } finally {
+      facesContext.release();
     }
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("outcome = '" + outcome + "'");
-    }
-    NavigationHandler navigationHandler = application.getNavigationHandler();
-    navigationHandler.handleNavigation(facesContext, null, outcome);
-    lifecycle.render(facesContext);
   }
 
   public abstract String invokeApplication(FacesContext facesContext);



Mime
View raw message