myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r697276 - /myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/tomahawk/util/ExternalContextUtils.java
Date Fri, 19 Sep 2008 23:22:39 GMT
Author: lu4242
Date: Fri Sep 19 16:22:39 2008
New Revision: 697276

URL: http://svn.apache.org/viewvc?rev=697276&view=rev
Log:
TOMAHAWK-1331 ExternalContextUtils.getRequestType() doesn't work in a portlet environment

Modified:
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/tomahawk/util/ExternalContextUtils.java

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/tomahawk/util/ExternalContextUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/tomahawk/util/ExternalContextUtils.java?rev=697276&r1=697275&r2=697276&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/tomahawk/util/ExternalContextUtils.java
(original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/tomahawk/util/ExternalContextUtils.java
Fri Sep 19 16:22:39 2008
@@ -158,22 +158,27 @@
 
     /**
      * This method is used when a ExternalContext object is not available,
-     * like in TomahawkFacesContextFactory.  
+     * like in TomahawkFacesContextFactory.
      * 
-     * @param config
+     * According to TOMAHAWK-1331, the object context could receive an
+     * instance of javax.portlet.PortletContext or javax.portlet.PortletConfig,
+     * so we check both cases.
+     * 
+     * @param context
      * @param request
      * @return
      */
-    public static final RequestType getRequestType(Object config, Object request)
+    public static final RequestType getRequestType(Object context, Object request)
     {
         //Stuff is laid out strangely in this class in order to optimize
         //performance.  We want to do as few instanceof's as possible so
         //things are laid out according to the expected frequency of the
         //various requests occurring.
 
-        if(_PORTLET_CONFIG_CLASS != null)
+        if(_PORTLET_CONTEXT_CLASS != null)
         {
-            if (_PORTLET_CONFIG_CLASS.isInstance(config))
+            if (_PORTLET_CONFIG_CLASS.isInstance(context) ||
+                _PORTLET_CONTEXT_CLASS.isInstance(context))
             {
                 //We are inside of a portlet container
                 



Mime
View raw message