You MAY be able to write an implementation of the jetty Handler interface that wrappers the Filter and configure that into the Jetty instance via CXF's jetty configuration stuff. Honestly, I'm really not sure if that will work, but may be worth a shot. :-(
Dan On Wednesday, April 18, 2012 06:05:39 PM Scott Parkerson wrote: > Is there a way to inject servlet filters into a JAX-RS application > deployed in OSGi without resorting to turning my bundle into a WAR? > > Currently, my RESTful application is deployed into Karaf 2.2.5 using CXF > 2.4.6, and started using a Spring configuration > (META-INF/spring/bundle-context.xml), like this: > > <jaxrs:server address="http://0.0.0.0:${web.serverListenPort}" > beanNames="fooBean barBean"> > <jaxrs:inInterceptors> > <ref bean="requestTimeInInterceptor" /> > </jaxrs:inInterceptors> > <jaxrs:outInterceptors> > <ref bean="requestTimeOutInterceptor" /> > </jaxrs:outInterceptors> > <jaxrs:features> > <cxf:logging /> > </jaxrs:features> > </jaxrs:server> > > Placeholder web.serverListenPort is resolved using the OSGi > Configuration Manager (META-INF/spring/bundle-context-osgi.xml). > > When I deploy my bundle, it starts up Jetty and listens to that port. > > What I would like to do is specify a servlet filter (namely, Spring's > DelegatingFilterProxy / springSecurityFilterChain) to sit in front of > CXF without resorting to using web.xml. Is this even possible using pure > Spring, or do I need to write a custom invoker, or something like that? > > --sgp -- Daniel Kulp [email protected] - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com
