myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skitch...@apache.org
Subject svn commit: r582256 - /myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterProviderManager.java
Date Fri, 05 Oct 2007 13:33:45 GMT
Author: skitching
Date: Fri Oct  5 06:33:44 2007
New Revision: 582256

URL: http://svn.apache.org/viewvc?rev=582256&view=rev
Log:
Remove unused method hasProviders.
Check for either of two "response wrapped" flags (filter and jsf-specific one).

Modified:
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterProviderManager.java

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterProviderManager.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterProviderManager.java?rev=582256&r1=582255&r2=582256&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterProviderManager.java
(original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/requestParameterProvider/RequestParameterProviderManager.java
Fri Oct  5 06:33:44 2007
@@ -22,6 +22,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter;
+import org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapterInterface;
 
 import java.io.Serializable;
 import java.util.ArrayList;
@@ -70,6 +71,7 @@
 
 		if (manager == null)
 		{
+			// TODO: remove this factory code. Not IOC-friendly.
 			manager = new RequestParameterProviderManager();
 			FrameworkAdapter.getInstance().setSessionAttribute(PARAMETER_PROVIDER_MANAGER_KEY, manager);
 		}
@@ -106,7 +108,7 @@
 
 	public String encodeAndAttachParameters(String url)
 	{
-		if (!isFilterCalled())
+		if (!isResponseIntercepted())
 		{
 			throw new IllegalStateException("RequestParameterServletFilter not called. Please configure
the filter " + RequestParameterServletFilter.class.getName() + " in your web.xml to cover
your faces requests.");
 		}
@@ -142,20 +144,12 @@
 		return sb.toString();
 	}
 
-
-	/**
-	 * Check if there are any providers registered.
-	 *
-	 * @return true, if the list is not null and not empty.
-	 */
-	public boolean hasProviders()
-	{
-		return this.providers != null && !this.providers.isEmpty();
-	}
-
-	public boolean isFilterCalled()
+	protected boolean isResponseIntercepted()
 	{
-		return Boolean.TRUE.equals(FrameworkAdapter.getInstance().getRequestAttribute(RequestParameterServletFilter.REQUEST_PARAM_FILTER_CALLED));
+		FrameworkAdapterInterface fa = FrameworkAdapter.getInstance();
+		
+		return Boolean.TRUE.equals(fa.getRequestAttribute(RequestParameterServletFilter.REQUEST_PARAM_FILTER_CALLED))
+			|| Boolean.TRUE.equals(fa.getRequestAttribute(RequestParameterServletFilter.REQUEST_PARAM_RESPONSE_WRAPPED));
 	}
 
 	protected List getProviders()



Mime
View raw message