openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r959621 - in /openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12: ConversationAwareViewHandler.java JSFUtil.java OwbApplicationFactory.java WebBeansPhaseListener.java
Date Thu, 01 Jul 2010 11:30:37 GMT
Author: gerdogdu
Date: Thu Jul  1 11:30:36 2010
New Revision: 959621

URL: http://svn.apache.org/viewvc?rev=959621&view=rev
Log:
When JSF related plugins put into the server classpath, it is used by the container even if
no OWB runtime exist. Adding some marker that provide we run in OWB environment.

Modified:
    openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/ConversationAwareViewHandler.java
    openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/JSFUtil.java
    openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/OwbApplicationFactory.java
    openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/WebBeansPhaseListener.java

Modified: openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/ConversationAwareViewHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/ConversationAwareViewHandler.java?rev=959621&r1=959620&r2=959621&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/ConversationAwareViewHandler.java
(original)
+++ openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/ConversationAwareViewHandler.java
Thu Jul  1 11:30:36 2010
@@ -40,6 +40,11 @@ public class ConversationAwareViewHandle
     @Override
     public String getActionURL(FacesContext context, String viewId)
     {
+        if(!JSFUtil.isOwbApplication())
+        {
+            return delegate.getActionURL(context, viewId);
+        }
+        
         String url = delegate.getActionURL(context, viewId);
 
         ConversationManager conversationManager = ConversationManager.getInstance();

Modified: openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/JSFUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/JSFUtil.java?rev=959621&r1=959620&r2=959621&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/JSFUtil.java
(original)
+++ openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/JSFUtil.java
Thu Jul  1 11:30:36 2010
@@ -26,6 +26,7 @@ import javax.faces.context.ExternalConte
 import javax.faces.context.FacesContext;
 import javax.servlet.http.HttpSession;
 
+import org.apache.webbeans.config.OpenWebBeansConfiguration;
 import org.apache.webbeans.util.Asserts;
 
 
@@ -185,4 +186,9 @@ public final class JSFUtil
         String cid = getJSFRequestParameter("cid");
         return cid;
     }
+    
+    public static boolean isOwbApplication()
+    {
+        return OpenWebBeansConfiguration.getInstance().isOwbApplication();
+    }    
 }

Modified: openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/OwbApplicationFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/OwbApplicationFactory.java?rev=959621&r1=959620&r2=959621&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/OwbApplicationFactory.java
(original)
+++ openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/OwbApplicationFactory.java
Thu Jul  1 11:30:36 2010
@@ -35,6 +35,11 @@ public class OwbApplicationFactory exten
     @Override
     public Application getApplication()
     {
+        if(!JSFUtil.isOwbApplication())
+        {
+            return wrapped.getApplication();
+        }
+        
         if(wrappedApplication == null)
         {
             wrappedApplication = new OwbApplication(wrapped.getApplication());

Modified: openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/WebBeansPhaseListener.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/WebBeansPhaseListener.java?rev=959621&r1=959620&r2=959621&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/WebBeansPhaseListener.java
(original)
+++ openwebbeans/trunk/webbeans-jsf12/src/main/java/org/apache/webbeans/jsf12/WebBeansPhaseListener.java
Thu Jul  1 11:30:36 2010
@@ -49,6 +49,11 @@ public class WebBeansPhaseListener imple
      */
     public void afterPhase(PhaseEvent phaseEvent)
     {
+        if(!JSFUtil.isOwbApplication())
+        {
+            return;
+        }
+        
         if (phaseEvent.getPhaseId().equals(PhaseId.RENDER_RESPONSE) ||
                 JSFUtil.getCurrentFacesContext().getResponseComplete())
         {
@@ -76,6 +81,11 @@ public class WebBeansPhaseListener imple
      */
     public void beforePhase(PhaseEvent phaseEvent)
     {
+        if(!JSFUtil.isOwbApplication())
+        {
+            return;
+        }
+        
         if (phaseEvent.getPhaseId().equals(PhaseId.RESTORE_VIEW))
         {
             //It looks for cid parameter in the JSF request.



Mime
View raw message