Hi Kent, Luis,
I do agree that a datasource should be in the logic
layer, not in the JSP/prsentation layer, but I have a
problem to populate the JSP combo box with data that
is retrieved from the database when they first logn
the page. And I think getting a datasource here is
good enouhg :) . Do you have any idea to avoid this.
thank you very much for your help. I think of
prepopulate but I donnot know how to implement it.
Binh
--- Luis Olivares <[EMAIL PROTECTED]> wrote:
> Why don't you put it inside a Custom Tag? That way
> you don't put it in the
> presentation layer.
>
> I think with the code sample that Craig shows us is
> possible.
>
> <%
> DataSource ds = (DataSource)
>
>
application.getAttribute("org.apache.struts.action.DATA_SOURCE");
> ...
> %>
>
> Am I right?
>
> Regards
>
> Luis Olivares.
> Infosphere S.A. de C.V.
> "Delivering the Power of Information"
>
>
-------------------------------------------------------------
> (52)8-365-42-88 Ext. 107.
> [EMAIL PROTECTED]
>
> ----- Original Message -----
> From: "Kent Roylance" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, August 13, 2001 9:27 PM
> Subject: RE: How can I get the DataSource from a JSP
> page
>
>
> > Binh,
> >
> > Why would you want to get a DataSource from a JSP
> page? I would not
> > recommend using a DataSource at the presentation
> level. Normally, you
> would
> > get the data from the action class and store it in
> the session so that
> your
> > presentation layer can use it. It is much easier
> that way, and a cleaner
> > separation of the data, business logic, and
> presentation layers. Just a
> > suggestion.
> >
> > Kent
> >
> > -----Original Message-----
> > From: BinhMinh Nguyen
> [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, August 13, 2001 5:51 PM
> > To: [EMAIL PROTECTED]
> > Subject: How can I get the DataSource from a JSP
> page
> >
> >
> > Hi,
> >
> > I know how to get a DataSource from a Action java
> > class
> > but I do not know how to obtain a DataSource from
> a
> > JSP page.
> > Please show me how.
> > thank you very much
> > Binh Nguyen
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Send instant messages & get email alerts with
> Yahoo! Messenger.
> > http://im.yahoo.com/
>
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/