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
<[email protected]>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
>