cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bruno tapdur <tapdu...@gmail.com>
Subject Re: get a Spring Bean from CXF, how to ?
Date Fri, 01 May 2009 15:36:39 GMT
thx , i use ApplicationContextAware and it works like a charm

Bruno

2009/5/1 Ian Roberts <i.roberts@dcs.shef.ac.uk>

> Tapdur wrote:
> > So my question is how to lookup Spring context from CXF and use the
> Spring
> > bean API at runtime ?
> > (how to lookup the Servlet Context too from CXF ?)
>
> Configure your implementation object as a Spring bean itself, i.e.
> instead of <jaxws:endpoint implementor="my.pkg.ServiceImpl"/> do
>
> <bean id="myServiceImpl" class="my.pkg.ServiceImpl" />
> <jaxws:endpoint implementor="#myServiceImpl" ... />
>
> Now your service object is a Spring bean it can implement
> Spring-provided interfaces such as ApplicationContextAware or
> ServletContextAware in the usual way and the things you want will be
> injected automatically.
>
> Ian
>
> --
> Ian Roberts               | Department of Computer Science
> i.roberts@dcs.shef.ac.uk  | University of Sheffield, UK
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message