You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jonathan Fuerth <fu...@sqlpower.ca> on 2001/07/06 17:45:10 UTC

Connection Pool from JSP tag?

Hello!

I've made up a custom JSP tag that I'm using with a struts
application: It loads an organisation hierarchy from a JDBC data
source and renders it to HTML.

My question is this: How does my JSP custom tag class ask the Struts
connection pool for one of its connections?


Thanks!

Jonathan Fuerth

Re: Connection Pool from JSP tag?

Posted by Ted Husted <hu...@apache.org>.
Struts exposes the connection pool as a javax.sql.DataSource in the
application context, and you can use that object to request a
connection. This works great with the Jakarta Taglibs dbTag, so it
should work for others as well. 

The name of the Datasource attribute is 

org.apache.struts.action.DATA_SOURCE


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/

Jonathan Fuerth wrote:
> 
> Hello!
> 
> I've made up a custom JSP tag that I'm using with a struts
> application: It loads an organisation hierarchy from a JDBC data
> source and renders it to HTML.
> 
> My question is this: How does my JSP custom tag class ask the Struts
> connection pool for one of its connections?
> 
> Thanks!
> 
> Jonathan Fuerth