Re: How to pass SQL variable from JSP to Action?

2005-09-01 Thread 梁炳�
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:
   

   


2005/9/2, 梁炳�� <[EMAIL PROTECTED]>:
> After 2nd thought, what if I want to display a no of lines which are
> actually links .
> 
> 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  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 
> > > to a no of forms 
> > > 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.
> > > > 
> > > >
> > > > When user clicks a 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
> > > > 
> > > >
> > > > 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]
> >
> >
>


Re: How to pass SQL variable from JSP to Action?

2005-09-01 Thread 梁炳�
After 2nd thought, what if I want to display a no of lines which are
actually links .

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  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 
> > to a no of forms 
> > 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.
> > > 
> > >
> > > When user clicks a 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
> > > 
> > >
> > > 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]
> 
>


Re: How to pass SQL variable from JSP to Action?

2005-09-01 Thread 梁炳�
Thanks 

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  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 
> > to a no of forms 
> > 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.
> > > 
> > >
> > > When user clicks a 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
> > > 
> > >
> > > 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]
> 
>


RE: How to pass SQL variable from JSP to Action?

2005-09-01 Thread Mark Benussi
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  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 
> to a no of forms 
> 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.
> > 
> >
> > When user clicks a 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
> > 
> >
> > 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]



Re: How to pass SQL variable from JSP to Action?

2005-09-01 Thread 梁炳�
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  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 
> to a no of forms 
> 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.
> > 
> >
> > When user clicks a 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
> > 
> >
> > 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]
> 
>


Re: How to pass sql variable from jsp to Action?

2005-08-31 Thread 梁炳場
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  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 
to a no of forms 
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.
> 
> 
> When user clicks a 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
> 
> 
> 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.
>