Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: getDataSource() in JSP

Jonathan Wright

2004-10-07

Replies:

Your DataSources are stored in the application context. Use your implicit
pageContext reference to get a reference to the servlet / application
context, then get your data source using
(DataSource)ctx.getAttribute("dataSource");

Jonathan Wright
----- Original Message -----
From: "Shailender Jain" <shailender.jain@(protected)>
To: <struts-user@(protected)>
Sent: Thursday, October 07, 2004 6:20 PM
Subject: getDataSource() in JSP


> Hello,
>
> I want to use the method getDataSource() from my JSP page.
> I want to use this since i am using some tag library to do some generic
> things.
>
> Can somebody let me know how i can use this function to get connection
> so that i can use them in tag library.
> In this tag i will pass some sql query and it will generate some combo
> box, table.
>
>
> Thanks,
> Shailender Jain
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.