--- [EMAIL PROTECTED] wrote:
> hi all,
>       i have configured a datasource in struts-config.xml, which is
> successfully loaded.
> now my problem is that i want to write a  component (which has
> application-context scope) which wraps
> the DataSource, so that individual action classes don't have to deal
> with PreparedStatement etc...
> so, this component needs to be initialized with the DataSource
> 
> my initiali idea whas to write a plugin for instantiating this
> component.
> But the only method that i can see for retreiving the configured
> datasource is servlet.getDataSource(request), and in the
> plugin initialization method there is no request.
> 
> does this method exist  servlet.getDataSource() ?
> 
> otherwise,does anyone have any alternative solutions?

Struts stores your DataSources in the ServletContext under the
Globals.DATA_SOURCE_KEY attribute (you can change this name in the
<data-source> element.  You can retrieve them just like any other object
you store in the ServletContext.

David

> 
> regards
>       marco
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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

Reply via email to