geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r110087 - in geronimo/branches/djencks/jetty-deployer1/trunk/modules: jetty-builder/src/java/org/apache/geronimo/jetty/deployment jetty-builder/src/test/org/apache/geronimo/jetty/deployment jetty/src/java/org/apache/geronimo/jetty
Date Tue, 07 Dec 2004 06:02:22 GMT
Author: djencks
Date: Mon Dec  6 22:02:21 2004
New Revision: 110087

URL: http://svn.apache.org/viewcvs?view=rev&rev=110087
Log:
Make sure explicit servlet mappings override implicit mappings from default servlets.  Implement
a 'first mapping wins' policy for duplicate url-patterns in servlet mappings.  Partially implement
default filters and filtermappings
Modified:
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyFilterHolder.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyFilterMapping.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?view=diff&rev=110087&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java&r1=110086&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java&r2=110087
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Mon Dec  6 22:02:21 2004
@@ -118,6 +118,8 @@
     private final URI defaultParentId;
     private final ObjectName jettyContainerObjectName;
     private final ObjectName defaultServlets;
+    private final ObjectName defaultFilters;
+    private final ObjectName defaultFilterMappings;
     private final SecurityService securityService;
 
     private final List defaultWelcomeFiles;
@@ -130,6 +132,8 @@
                               List defaultWelcomeFiles,
                               ObjectName jettyContainerObjectName,
                               ObjectName defaultServlets,
+                              ObjectName defaultFilters,
+                              ObjectName defaultFilterMappings,
                               SecurityService securityService,
                               Kernel kernel) {
         this.defaultParentId = defaultParentId;
@@ -137,10 +141,11 @@
         this.jettyContainerObjectName = jettyContainerObjectName;
         this.securityService = securityService;
         this.defaultServlets = defaultServlets;
+        this.defaultFilters = defaultFilters;
+        this.defaultFilterMappings = defaultFilterMappings;
         this.kernel = kernel;
 
         //todo locale mappings
-        //todo jsr154 filter
 
         this.defaultWelcomeFiles = defaultWelcomeFiles;
     }
@@ -514,23 +519,89 @@
             }
             earContext.addGBean(webModuleData);
 
+            //never add a duplicate pattern.
+            Set knownServletMappings = new HashSet();
+
             ServletMappingType[] servletMappingArray = webApp.getServletMappingArray();
             Map servletMappings = new HashMap();
             for (int i = 0; i < servletMappingArray.length; i++) {
                 ServletMappingType servletMappingType = servletMappingArray[i];
                 String servletName = servletMappingType.getServletName().getStringValue().trim();
                 String urlPattern = servletMappingType.getUrlPattern().getStringValue();
-                checkString(urlPattern);
-                Set urlsForServlet = (Set) servletMappings.get(servletName);
-                if (urlsForServlet == null) {
-                    urlsForServlet = new HashSet();
-                    servletMappings.put(servletName, urlsForServlet);
+                if (!knownServletMappings.contains(urlPattern)) {
+                    knownServletMappings.add(urlPattern);
+                    checkString(urlPattern);
+                    Set urlsForServlet = (Set) servletMappings.get(servletName);
+                    if (urlsForServlet == null) {
+                        urlsForServlet = new HashSet();
+                        servletMappings.put(servletName, urlsForServlet);
+                    }
+                    urlsForServlet.add(urlPattern);
                 }
-                urlsForServlet.add(urlPattern);
             }
 
-            FilterMappingType[] filterMappingArray = webApp.getFilterMappingArray();
+            //"previous" filter mapping for linked list to keep dd's ordering.
             ObjectName previous = null;
+
+            //add default filters
+            if (defaultFilters != null) {
+                Set defaultFilterNames = kernel.listGBeans(defaultFilters);
+                for (Iterator iterator = defaultFilterNames.iterator(); iterator.hasNext();)
{
+
+                    GBeanData filterGBeanData = kernel.getGBeanData((ObjectName) iterator.next());
+                    String filterName = (String) filterGBeanData.getAttribute("filterName");
+                    ObjectName defaultFilterObjectName = NameFactory.getWebComponentName(null,
null, null, null, filterName, NameFactory.WEB_FILTER, moduleJ2eeContext);
+                    filterGBeanData.setName(defaultFilterObjectName);
+                    filterGBeanData.setReferencePattern("JettyServletRegistration", webModuleName);
+                    earContext.addGBean(filterGBeanData);
+                    //add a mapping to /*
+
+                    GBeanData filterMappingGBeanData = new GBeanData(JettyFilterMapping.GBEAN_INFO);
+                    filterMappingGBeanData.setReferencePattern("Previous", previous);
+                    filterMappingGBeanData.setReferencePattern("JettyServletRegistration",
webModuleName);
+                    String urlPattern = "/*";
+                    filterMappingGBeanData.setAttribute("urlPattern", urlPattern);
+                    ObjectName filterMappingName = NameFactory.getWebFilterMappingName(null,
null, null, null, filterName, null, urlPattern, moduleJ2eeContext);
+                    filterMappingGBeanData.setName(filterMappingName);
+                    previous = filterMappingName;
+
+
+                    filterMappingGBeanData.setAttribute("requestDispatch", Boolean.TRUE);
+                    filterMappingGBeanData.setAttribute("forwardDispatch", Boolean.TRUE);
+                    filterMappingGBeanData.setAttribute("includeDispatch", Boolean.TRUE);
+                    filterMappingGBeanData.setAttribute("errorDispatch", Boolean.FALSE);
+                    filterMappingGBeanData.setReferencePattern("Filter", defaultFilterObjectName);
+                    earContext.addGBean(filterMappingGBeanData);
+                }
+            }
+
+            //add default filtermappings
+//            if (defaultFilterMappings != null) {
+//                Set defaultFilterMappingNames = kernel.listGBeans(defaultFilterMappings);
+//                for (Iterator iterator = defaultFilterMappingNames.iterator(); iterator.hasNext();)
{
+//
+//                    GBeanData filterMappingGBeanData = kernel.getGBeanData((ObjectName)
iterator.next());
+//                    String filterName = (String) filterMappingGBeanData.getAttribute("filterName");
+//                    ObjectName defaultFilterMappingObjectName;
+//                    if (filterMappingGBeanData.getAttribute("urlPattern") != null) {
+//                        String urlPattern = (String) filterMappingGBeanData.getAttribute("urlPattern");
+//                        defaultFilterMappingObjectName = NameFactory.getWebFilterMappingName(null,
null, null, null, filterName, null, urlPattern, moduleJ2eeContext);
+//                    } else {
+//                        Set servletNames = filterMappingGBeanData.getReferencePatterns("Servlet");
+//                        if (servletNames == null || servletNames.size() != 1) {
+//                            throw new DeploymentException("Exactly one servlet name must
be supplied");
+//                        }
+//                        ObjectName servletObjectName = (ObjectName) servletNames.iterator().next();
+//                        String servletName = servletObjectName.getKeyProperty("name");
+//                        defaultFilterMappingObjectName = NameFactory.getWebFilterMappingName(null,
null, null, null, filterName, servletName, null, moduleJ2eeContext);
+//                    }
+//                    filterMappingGBeanData.setName(defaultFilterMappingObjectName);
+//                    filterMappingGBeanData.setReferencePattern("JettyFilterMappingRegistration",
webModuleName);
+//                    earContext.addGBean(filterMappingGBeanData);
+//                }
+//            }
+
+            FilterMappingType[] filterMappingArray = webApp.getFilterMappingArray();
             for (int i = 0; i < filterMappingArray.length; i++) {
                 FilterMappingType filterMappingType = filterMappingArray[i];
                 String filterName = filterMappingType.getFilterName().getStringValue().trim();
@@ -599,14 +670,19 @@
             }
 
             //add default servlets
-            Set defaultServletNames = kernel.listGBeans(defaultServlets);
-            for (Iterator iterator = defaultServletNames.iterator(); iterator.hasNext();)
{
-
-                GBeanData servletGBeanData = kernel.getGBeanData((ObjectName) iterator.next());
-                ObjectName defaultServletObjectName = NameFactory.getWebComponentName(null,
null, null, null, (String) servletGBeanData.getAttribute("servletName"), NameFactory.SERVLET,
moduleJ2eeContext);
-                servletGBeanData.setName(defaultServletObjectName);
-                servletGBeanData.setReferencePattern("JettyServletRegistration", webModuleName);
-                earContext.addGBean(servletGBeanData);
+            if (defaultServlets != null) {
+                Set defaultServletNames = kernel.listGBeans(defaultServlets);
+                for (Iterator iterator = defaultServletNames.iterator(); iterator.hasNext();)
{
+
+                    GBeanData servletGBeanData = kernel.getGBeanData((ObjectName) iterator.next());
+                    ObjectName defaultServletObjectName = NameFactory.getWebComponentName(null,
null, null, null, (String) servletGBeanData.getAttribute("servletName"), NameFactory.SERVLET,
moduleJ2eeContext);
+                    servletGBeanData.setName(defaultServletObjectName);
+                    servletGBeanData.setReferencePattern("JettyServletRegistration", webModuleName);
+                    Set defaultServletMappings = new HashSet((Collection) servletGBeanData.getAttribute("servletMappings"));
+                    defaultServletMappings.removeAll(knownServletMappings);
+                    servletGBeanData.setAttribute("servletMappings", defaultServletMappings);
+                    earContext.addGBean(servletGBeanData);
+                }
             }
 
             //set up servlet gbeans.
@@ -642,6 +718,7 @@
                 Set mappings = (Set) servletMappings.get(servletName);
                 servletData.setAttribute("servletMappings", mappings == null ? Collections.EMPTY_SET
: mappings);
 
+
                 //WebRoleRefPermissions
                 SecurityRoleRefType[] securityRoleRefTypeArray = servletType.getSecurityRoleRefArray();
                 Map webRoleRefPermissions = new HashMap();
@@ -1052,6 +1129,8 @@
         infoBuilder.addAttribute("defaultWelcomeFiles", List.class, true);
         infoBuilder.addAttribute("jettyContainerObjectName", ObjectName.class, true);
         infoBuilder.addAttribute("defaultServlets", ObjectName.class, true);
+        infoBuilder.addAttribute("defaultFilters", ObjectName.class, true);
+        infoBuilder.addAttribute("defaultFilterMappings", ObjectName.class, true);
         infoBuilder.addReference("SecurityService", SecurityService.class);
         infoBuilder.addAttribute("kernel", Kernel.class, false);
         infoBuilder.addInterface(ModuleBuilder.class);
@@ -1062,6 +1141,8 @@
             "defaultWelcomeFiles",
             "jettyContainerObjectName",
             "defaultServlets",
+            "defaultFilters",
+            "defaultFilterMappings",
             "SecurityService",
             "kernel"});
         GBEAN_INFO = infoBuilder.getBeanInfo();

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java?view=diff&rev=110087&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java&r1=110086&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java&r2=110087
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
Mon Dec  6 22:02:21 2004
@@ -188,7 +188,7 @@
         ObjectName defaultServlets = ObjectName.getInstance("test:name=test,type=none,*");
         SecurityServiceImpl securityService = new SecurityServiceImpl("org.apache.geronimo.security.jacc.GeronimoPolicyConfigurationFactory",
null, null);
 
-        builder = new JettyModuleBuilder(new URI("null"), new Integer(1800), Collections.EMPTY_LIST,
containerName, defaultServlets, securityService, kernel);
+        builder = new JettyModuleBuilder(new URI("null"), new Integer(1800), Collections.EMPTY_LIST,
containerName, defaultServlets, null, null, securityService, kernel);
 
         container = new GBeanData(containerName, JettyContainerImpl.GBEAN_INFO);
 

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java?view=diff&rev=110087&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java&r1=110086&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java&r2=110087
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
Mon Dec  6 22:02:21 2004
@@ -1,22 +1,20 @@
 package org.apache.geronimo.jetty.deployment;
 
 import java.io.File;
-import java.util.ArrayList;
-
 import javax.management.ObjectName;
 
 import junit.framework.TestCase;
+import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.xbeans.geronimo.jetty.JettyWebAppDocument;
 import org.apache.geronimo.xbeans.geronimo.jetty.JettyWebAppType;
 import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
 
 /**
  */
 public class PlanParsingTest extends TestCase {
     ObjectName jettyContainerObjectName = JMXUtil.getObjectName("test:type=JettyContainer");
-    private JettyModuleBuilder builder = new JettyModuleBuilder(null, new Integer(1800),
null, jettyContainerObjectName, null, null, null);
+    private JettyModuleBuilder builder = new JettyModuleBuilder(null, new Integer(1800),
null, jettyContainerObjectName, null, null, null, null, null);
     private File basedir = new File(System.getProperty("basedir", "."));
 
     public void testResourceRef() throws Exception {

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyFilterHolder.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyFilterHolder.java?view=diff&rev=110087&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyFilterHolder.java&r1=110086&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyFilterHolder.java&r2=110087
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyFilterHolder.java
(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyFilterHolder.java
Mon Dec  6 22:02:21 2004
@@ -33,10 +33,12 @@
     }
 
     public JettyFilterHolder(String filterName, String filterClass, Map initParams, JettyServletRegistration
jettyServletRegistration) throws Exception {
-        super(jettyServletRegistration.getServletHandler(), filterName, filterClass);
-        ((WebApplicationHandler)jettyServletRegistration.getServletHandler()).addFilterHolder(this);
-        putAll(initParams);
-        start();
+        super(jettyServletRegistration == null? null: jettyServletRegistration.getServletHandler(),
filterName, filterClass);
+        if (jettyServletRegistration != null) {
+            ((WebApplicationHandler)jettyServletRegistration.getServletHandler()).addFilterHolder(this);
+            putAll(initParams);
+            start();
+        }
     }
 
     public String getFilterName() {

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyFilterMapping.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyFilterMapping.java?view=diff&rev=110087&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyFilterMapping.java&r1=110086&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyFilterMapping.java&r2=110087
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyFilterMapping.java
(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyFilterMapping.java
Mon Dec  6 22:02:21 2004
@@ -60,9 +60,7 @@
                               JettyServletHolder jettyServletHolder,
                               JettyFilterMapping previous,
                               JettyServletRegistration jettyServletRegistration) {
-        assert jettyServletRegistration != null;
-        assert jettyServletHolder != null ^ urlPattern != null;
-        this.urlPattern = urlPattern;
+       this.urlPattern = urlPattern;
         this.requestDispatch = requestDispatch;
         this.forwardDispatch = forwardDispatch;
         this.includeDispatch = includeDispatch;
@@ -72,27 +70,31 @@
         this.previous = previous;
         this.jettyServletRegistration = jettyServletRegistration;
 
-        String filterName = jettyFilterHolder.getFilterName();
-        int dispatches = 0;
-        if (requestDispatch) {
-            dispatches |= FilterHolder.__REQUEST;
-        }
-        if (forwardDispatch) {
-            dispatches |= FilterHolder.__FORWARD;
-        }
-        if (includeDispatch) {
-            dispatches |= FilterHolder.__INCLUDE;
-        }
-        if (errorDispatch) {
-            dispatches |= FilterHolder.__ERROR;
-        }
+        if (jettyServletRegistration != null) {
+            assert jettyServletHolder != null ^ urlPattern != null;
 
+            String filterName = jettyFilterHolder.getFilterName();
+            int dispatches = 0;
+            if (requestDispatch) {
+                dispatches |= FilterHolder.__REQUEST;
+            }
+            if (forwardDispatch) {
+                dispatches |= FilterHolder.__FORWARD;
+            }
+            if (includeDispatch) {
+                dispatches |= FilterHolder.__INCLUDE;
+            }
+            if (errorDispatch) {
+                dispatches |= FilterHolder.__ERROR;
+            }
 
-        if (jettyServletHolder == null) {
-            ((WebApplicationHandler)jettyServletRegistration.getServletHandler()).addFilterPathMapping(urlPattern,
filterName, dispatches);
-        } else {
-            String servletName = jettyServletHolder.getServletName();
-            ((WebApplicationHandler)jettyServletRegistration.getServletHandler()).addFilterServletMapping(servletName,
filterName, dispatches);
+
+            if (jettyServletHolder == null) {
+                ((WebApplicationHandler)jettyServletRegistration.getServletHandler()).addFilterPathMapping(urlPattern,
filterName, dispatches);
+            } else {
+                String servletName = jettyServletHolder.getServletName();
+                ((WebApplicationHandler)jettyServletRegistration.getServletHandler()).addFilterServletMapping(servletName,
filterName, dispatches);
+            }
         }
     }
 

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java?view=diff&rev=110087&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java&r1=110086&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java&r2=110087
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
Mon Dec  6 22:02:21 2004
@@ -17,7 +17,6 @@
 
 package org.apache.geronimo.jetty;
 
-import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
 import java.util.Collection;
@@ -45,6 +44,8 @@
 import org.mortbay.http.Authenticator;
 import org.mortbay.http.HttpRequest;
 import org.mortbay.http.HttpResponse;
+import org.mortbay.jetty.servlet.FilterHolder;
+import org.mortbay.jetty.servlet.JSR154Filter;
 import org.mortbay.jetty.servlet.ServletHolder;
 import org.mortbay.jetty.servlet.WebApplicationContext;
 import org.mortbay.jetty.servlet.WebApplicationHandler;
@@ -105,7 +106,7 @@
 
                               TransactionContextManager transactionContextManager,
                               TrackedConnectionAssociator trackedConnectionAssociator,
-                              JettyContainer jettyContainer) throws MalformedURLException,
IllegalAccessException, InstantiationException, ClassNotFoundException {
+                              JettyContainer jettyContainer) throws Exception, IllegalAccessException,
InstantiationException, ClassNotFoundException {
 
         assert uri != null;
         assert componentContext != null;
@@ -161,6 +162,12 @@
         interceptor = new WebApplicationContextBeforeAfter(interceptor, index++, this);
         chain = interceptor;
         contextLength = index;
+
+        //cheat -- add jsr154 filter not as a gbean
+        FilterHolder jsr154FilterHolder = new FilterHolder(handler, "jsr154", JSR154Filter.class.getName());
+        handler.addFilterHolder(jsr154FilterHolder);
+        jsr154FilterHolder.setInitParameter("unwrappedDispatch", "true");
+        handler.addFilterPathMapping("/*", "jsr154", JettyFilterHolder.__REQUEST | JettyFilterHolder.__FORWARD
| JettyFilterHolder.__INCLUDE);
     }
 
     public Object enterContextScope(HttpRequest httpRequest, HttpResponse httpResponse) {

Mime
View raw message