As per Ted's suggestion, I've submitted a patch:
(See bug http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6869)

Did not attempt any doc as per multi-app (perhaps after I've gone
through the multi app a little bit).  But at least the
doc is (will be) up to date.

In any case, will continue watch this thread (as per Martin's
explorations)...

- Gidado

-----Original Message-----
From: Martin Cooper
To: Struts Developers List
Sent: 3/5/2002 12:33 AM
Subject: Re: struts 1.1 doc (UserGuide: 2.6 accessing relational databases)

The deprecation comment in findDataSource() says:

"Look up data sources directly in servlet context attributes"

However, unless I'm missing something, this seems to involve knowledge
of
how the servlet context attribute names are constructed, which is
non-obvious. I think we need to provide a better way of accessing the
data
sources.

All of the find*() methods in ActionServlet have been deprecated. With
the
exception of data sources, they have been replaced by access through the
ApplicationConfig object, which makes sense. Since the data sources are
specified in the config, but not actually loaded there, we need a
separate
home for the data sources.

One idea I came up with was a DataSources class like this:

public class DataSources {

    // Get a data source configured for the current module
    public static DataSource get(HttpServletRequest request, String key)
{
... }

    // Get a data source configured for the specified module
    public static DataSource get(String module, String key) { ... }
}

I really haven't thought about this a whole heck of a lot, so this might
not
make sense, but I wanted to throw it out there as a starting point.
Comments
and suggestions are welcome.

--
Martin Cooper


----- Original Message -----
From: "Ted Husted" <[EMAIL PROTECTED]>
To: "Struts Developers List" <[EMAIL PROTECTED]>
Sent: Monday, March 04, 2002 6:36 PM
Subject: Re: struts 1.1 doc (UserGuide: 2.6 accessing relational
databases)


> If you'd like to post your recommended method to bugzilla as an
> enhancment request, that would be great.
>
> If anyone has notes or revised documentation to share regarding using
> the new features, that would be equally great.
>
> -Ted.
>
>
> "Immanuel, Gidado-Yisa" wrote:
> >
> > Since the method
> >
> >   ActionServlet.findDataSources()
> >
> > has been deprecated, it would be great if the doc for the 1.1
> > release could show the recommended method of doing this (not
> > that it's difficult to figure out).
> >
> > - Gidado
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>


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

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

Reply via email to