cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mick Knutson <mickknut...@gmail.com>
Subject Re: DI in an Impl class
Date Sun, 20 Sep 2009 14:05:56 GMT
In your applicationContext you inject the dao like:

    <!-- Services Bean... -->
    <bean id="messageService"
class="com.baselogic.service.impl.MessageServiceImpl">
        <property name="myDataAccessService" ref="myDataAccessService" />
    </bean>

    <!-- DAO Bean... -->
    <bean id="myDataAccessService"
class="com.baselogic.service.impl.MyDataAccessServiceImpl">
    </bean>


---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring & Agile Consulting
p. (866) BLiNC-411: (254-6241-1)
f. (415) 685-4233

Website: http://baselogic.com
Linked IN: http://linkedin.com/in/mickknutson
Vacation Rental: http://tahoe.baselogic.com
---



On Sun, Sep 20, 2009 at 4:42 AM, Nishant Chandra
<nishant.chandra@gmail.com>wrote:

> Hi,
>
> I have a WS impl like this:
>
> @WebService(endpointInterface = "com.service.AService",
> serviceName="AService")
> public class AServiceImpl implements AService {
>
> public String aM(String aKey) {
>
> ...
> }
>
> }
>
> I have a bean definition:
>
> <bean id="mKDao" class="com.dao.MDao"/>
>
> How can I inject this "mKDao" in the aM method above? Will @Resource
> work or there is another way?
>
> In the servlet, I could use the statement below and get the bean.
> WebApplicationContext ctx =
> WebApplicationContextUtils.getWebApplicationContext(getServletContext());
>
> Nishant
>

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