On Sun, 5 Aug 2001, Ted Husted wrote:
> "Craig R. McClanahan" wrote:
> > > The Generic Connection Pool works fine with the dbTags, but they can
> > > lookup the DataSource through the pageContext.
>
> It was added late in the development cycle, but they do support JNDI
> lookups, as well as a DataSource in the ServletContext, and so they are
> compatible with Struts, and also with gizmos like PoolMan.
>
> There is also a patch pending that I gave to Morgan which extends the
> ResultSet tag for RowSets. The JAR is on More About Struts if anyone is
> in a hurry ;-)
>
> < http://husted.com/about/struts >
>
> > Unfortunately, from the perspective of the web application, the JNDI
> > context created for you by the app server is read only, and is configured
> > solely through container-specific administration.
>
> Being read-only is fine, but it sounds like how the ServletContext would
> be accessed by other players is undefined. Pity, since, as you noted, it
> would help with tier separation. But, Tomcat 4's support for JNDI Data
> Sources will solve the immediate problem. I had been using another
> container that supports this too, but need to have it work with Tomcat
> as well. (After all, everything should ;-)
>
That's one of the reasons I wanted this in Tomcat ... so that others would
be forced to :-).
If you're willing to stray into being Tomcat-4--specific, you can actually
create your own object factories for other kinds of resources besides
connection pools. (There is a standard one to create JavaMail sessions,
for example). Thus, it *would* be possible in Tomcat to expose the Struts
resources this way, but it would not be portable.
> -Ted.
>
Craig