I just read the Struts user guide again.
Is it the right track to go?
In Action:
ResultSet rs = ...;
ResultSetDynaClass rsdc = new ResultSetDynaClass(rs);
Iterator rows = rsdc.iterator();
while (rows.hasNext()) {
DynaBean row = (DynaBean) rows.next();
... process this row ...
}
rs.close();
In JSP:
<logic-el:iterate name="stringbean" property="stringArray" id="foo"
indexId="ctr">
<html-el:text name="stringbean"
property="labelValue[${ctr}].label" />
</logic-el:iterate>
2005/9/2, 梁炳�� <[EMAIL PROTECTED]>:
> After 2nd thought, what if I want to display a no of lines which are
> actually links <html:link>.
>
> How can it be done with selecting data in Action via ActionForm
> and displaying them by jsp?
>
>
>
> 2005/9/1, Mark Benussi <[EMAIL PROTECTED]>:
> > No he is saying don't look up data in a JSP.
> >
> > Look it up in a Struts action and place in the presentation layer via an
> > ActionForm etc before showing the JSP
> >
> > -----Original Message-----
> > From: ??? [mailto:[EMAIL PROTECTED]
> > Sent: 01 September 2005 15:09
> > To: Struts Users Mailing List
> > Subject: Re: How to pass SQL variable from JSP to Action?
> >
> > Richard
> >
> > Are you suggesting something like Hibernate or iBatis?
> >
> > Daniel
> >
> >
> > 2005/9/1, R. Markham <[EMAIL PROTECTED]>:
> > > Hallo Nobody(??)
> > >
> > > It is bad practice to put SQL Statement in a JSP page.
> > >
> > > Regards
> > >
> > > Richard Markham
> > >
> > >
> > > -----Ursprüngliche Nachricht-----
> > > Von: ??? [mailto:[EMAIL PROTECTED]
> > > Gesendet: Donnerstag, 1. September 2005 05:30
> > > An: Struts Users Mailing List
> > > Betreff: Re: How to pass sql variable from jsp to Action?
> > >
> > > I wonder if it is a proper way to do it because
> > > the 1st query displays a no of rows with different group ids.
> > > Can the <html:link> pass a value to Action?
> > > If it can, it is excellent.
> > >
> > > Should it be done like this?
> > > change the layout from a no of links <html:link>
> > > to a no of forms <html:form>
> > > In each form, it has hidden value of group id.
> > >
> > > How will you do this? Thank you very much for your help.
> > >
> > > 2005/9/1, 梁炳�� <[EMAIL PROTECTED]>:
> > > > I retrieve a group id by JSP.
> > > > <sql:query ...SELECT group_id../>
> > > >
> > > > When user clicks a link
> > > > <html:link .../>
> > > >
> > > > Before another page is shown, in my struts-config.xml,
> > > > I try to make a ActionForward function to capture the group_id
> > > > and then update a session attribute .
> > > >
> > > > Then the resulting jsp is like this
> > > > <sql:query SELECT someValue FROM .. WHERE group_id = ???groupId??? />
> > > >
> > > > Is this a proper way to do this?
> > > >
> > > > I do not know how to write in the Action class so that
> > > > it can retrieve the sql value from the passing in jsp file.
> > > >
> > > > Your help is very much appreicated.
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>