tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r894365 - /tomcat/trunk/java/org/apache/catalina/deploy/FilterMap.java
Date Tue, 29 Dec 2009 12:21:43 GMT
Author: markt
Date: Tue Dec 29 12:21:42 2009
New Revision: 894365

URL: http://svn.apache.org/viewvc?rev=894365&view=rev
Log:
Expose string array of dispatcher names

Modified:
    tomcat/trunk/java/org/apache/catalina/deploy/FilterMap.java

Modified: tomcat/trunk/java/org/apache/catalina/deploy/FilterMap.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/FilterMap.java?rev=894365&r1=894364&r2=894365&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/deploy/FilterMap.java (original)
+++ tomcat/trunk/java/org/apache/catalina/deploy/FilterMap.java Tue Dec 29 12:21:42 2009
@@ -21,6 +21,7 @@
 
 import org.apache.catalina.util.RequestUtil;
 import java.io.Serializable;
+import java.util.ArrayList;
 
 import javax.servlet.DispatcherType;
 
@@ -166,6 +167,25 @@
         return dispatcherMapping; 
     }
 
+    public String[] getDispatcherNames() {
+    	ArrayList<String> result = new ArrayList<String>();
+    	if ((dispatcherMapping & FORWARD) > 0) {
+    		result.add(DispatcherType.FORWARD.name());
+    	}
+    	if ((dispatcherMapping & INCLUDE) > 0) {
+    		result.add(DispatcherType.INCLUDE.name());
+    	}
+    	if ((dispatcherMapping & REQUEST) > 0) {
+    		result.add(DispatcherType.REQUEST.name());
+    	}
+    	if ((dispatcherMapping & ERROR) > 0) {
+    		result.add(DispatcherType.ERROR.name());
+    	}
+    	if ((dispatcherMapping & ASYNC) > 0) {
+    		result.add(DispatcherType.ASYNC.name());
+    	}
+    	return result.toArray(new String[result.size()]);
+    }
 
     // --------------------------------------------------------- Public Methods
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message