dev@jersey.java.net

Spring/Jersey

From: Dan Diephouse <dan.diephouse_at_mulesource.com>
Date: Sat, 15 Sep 2007 10:47:13 +0200

Was just reading:

http://weblogs.java.net/blog/mhadley/archive/2007/09/integrating_jer.html

Re: the last question about - how do you get spring to create the beans
and pass in parameters from Jersey, you can use the
BeanConfigurerSuppport related classes. In essence you instantiate the
bean, then pass it into spring to be configured. Here's an example from
Apache CXF (couldn't find any real good examples in the spring manual):

http://fisheye6.cenqua.com/browse/celtixfire/trunk/rt/core/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java?r=544506

configureBean() is the most important method I think. Note that your
bean in spring will need to be declared abstract though:

<bean id="myBeanWiredByJersey" abstract="true">
   <property .../>
</bean>

No need to declare a class on it.

Hope that helps,

- Dan


-- 
Dan Diephouse
MuleSource
http://mulesource.com | http://netzooid.com/blog