Jelajahi Sumber

Retrieve bean from parent bean factory if not found, as per http://forum.springframework.org/viewtopic.php?t=3005.

Ben Alex 20 tahun lalu
induk
melakukan
cc669f4e35

+ 4 - 1
core/src/main/java/org/acegisecurity/util/FilterToBeanProxy.java

@@ -15,6 +15,8 @@
 
 package net.sf.acegisecurity.util;
 
+import org.springframework.beans.factory.BeanFactoryUtils;
+
 import org.springframework.context.ApplicationContext;
 
 import org.springframework.web.context.support.WebApplicationContextUtils;
@@ -167,7 +169,8 @@ public class FilterToBeanProxy implements Filter {
                     + " not found in classloader");
             }
 
-            Map beans = ctx.getBeansOfType(targetClass, true, true);
+            Map beans = BeanFactoryUtils.beansOfTypeIncludingAncestors(ctx,
+                    targetClass, true, true);
 
             if (beans.size() == 0) {
                 throw new ServletException(