>From ActionServlet.findDatasource() API docs:
Deprecated. Look up data sources directly in servlet context attributes

So I replaced my call to :
dataSource = getServlet().findDatasource(null);

with:
dataSource = 
(DataSource)getServlet().getServletContext().getAttribute(this.DATA_SOURCE_KEY);

And my datasource is retuned as null.

Anyone know what's going on?

Craig.

>From: "Craig Tataryn" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: Datasource Retrieval in 1.1
>Date: Thu, 05 Sep 2002 14:09:35 -0500
>
>Ok, read the DTD for struts-config.xml and figured out that I would use the 
>"key" attribute if I were to add another datasource.  I would still like to 
>know how to retrieve the datasource without using the deprecated 
>findDatasource() method.
>
>Thanks,
>
>Craig.
>
>
>>From: "Craig Tataryn" <[EMAIL PROTECTED]>
>>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>>To: [EMAIL PROTECTED]
>>Subject: Datasource Retrieval in 1.1
>>Date: Thu, 05 Sep 2002 11:30:39 -0500
>>
>>The documentation still lists the old way of how to retrieve a datasource 
>>which has been setup in struts-config.xml using findDatasource();
>>
>>The API says to "use datasource stored in attributes".  Can someone give 
>>an example of how I might do this from within my execute method?  I want 
>>to get rid of my deprecation warnings for findDatasource()
>>
>>As well, I believe you can have multiple datasources setup in 
>>struts-config.xml.  The default datasource being keyed by 
>>org.apache.struts.action.Action.DATA_SOURCE_KEY.  Could someone point me 
>>to an example of multiple datasources and how to setup keys for each?
>>
>>Thanks,
>>
>>Craig.
>>
>>Craig W. Tataryn
>>Programmer/Analyst
>>Compuware
>>
>>_________________________________________________________________
>>Join the world’s largest e-mail service with MSN Hotmail. 
>>http://www.hotmail.com
>>
>>
>>--
>>To unsubscribe, e-mail:   
>><mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail: 
>><mailto:[EMAIL PROTECTED]>
>
>
>Craig W. Tataryn
>Programmer/Analyst
>Compuware
>
>_________________________________________________________________
>MSN Photos is the easiest way to share and print your photos: 
>http://photos.msn.com/support/worldwide.aspx
>
>
>--
>To unsubscribe, e-mail:   
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: 
><mailto:[EMAIL PROTECTED]>


Craig W. Tataryn
Programmer/Analyst
Compuware

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to