You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by t t <wa...@yahoo.com> on 2004/10/17 17:19:39 UTC

RE: Help ! Question regarding Action and Form Bean(trouble remains )!

Hi, Joe,

Thank you for your quick answer. I did let A1 forward
to J2 first. But I didn't figure out how to associate
both F1 and F2 to A1. That's why I broke A1 to A1 and
A2, and associate F1 to A1, F2 to A2. But It still
didn't work. And that's why I came up the original
question: How to associate two form beans to one
action?

Thanks.
Tong
--- Joe Hertz <jh...@speakeasy.net> wrote:

> What you want is for A1 to forward to J2. Not A2.
> 
> J2 will display and then submit F2 to A2.
> 
> Forwarding from one action to another is almost
> always bad (Okay, I admit
> that I've done it in some cases where I *know* the
> Action won't ever care
> about the request parameters. This clearly isn't one
> of those cases.)
> 
> -Joe
> 
> 
> > Hi, Joe,
> > Thank you for your answer.Let me describe it in
> > detail. I have two jsp files, let me name them j1
> and
> > j2.j1 has form f1, and j2 f2. In f2, there is a
> > checkbox. f1 triggers an action (a1) which will
> look
> > at the data in f1 and end up in j2. Currently, I
> let
> > a1 associate f1, and forward to another action a2,
> a2
> > associate with f2. But the server always says no
> > getter mathod for the checkbox. But there is a
> getter
> > method in form bean f2.
> > Any help will be appreciated!
> >
> > tong
> >
> > --- Joe Hertz <jh...@speakeasy.net> wrote:
> >
> > > It would help if you described this in more
> detail.
> > > I hope this explains it
> > > for you.
> > >
> > > If you have a JSP that submits a form using
> > > <html:form>, you have to have
> > > that action associated to that form, otherwise
> you
> > > will get an exception
> > > when that JSP is loaded.
> > >
> > > If you have a JSP that wants to display data in
> a
> > > form bean (or any other
> > > bean really) but doesn't need to submit it to an
> > > action, you don't need to
> > > do anything special. You can generate the data
> your
> > > action and pass it to
> > > the JSP using request.setAttribute(String,
> Object).
> > > Your JSP just needs to
> > > refer to it by the name you passed into it. I
> often
> > > use formBeans for this
> > > purpose just because DynaBeans are easy to
> define,
> > > and with Hubert Rabago's
> > > FormDef plugin, it's pretty trivial to get
> DynaForm
> > > beans instantiated and
> > > populated with exactly what I need on the
> display
> > > side.
> > >
> > > > -----Original Message-----
> > > > From: t t [mailto:wantte03@yahoo.com]
> > > > Sent: Saturday, October 16, 2004 7:36 PM
> > > > To: user@struts.apache.org
> > > > Subject: Help ! Question regarding Action and
> Form
> > > Bean!
> > > >
> > > >
> > > > Hi,all,
> > > >
> > > > My action is triggered in one jsp file, and
> will
> > > end
> > > > up in another JSP file, both have a form bean
> > > inside.
> > > > And the action has to deal with both form
> beans.
> > > > Question: How can I associate both form bean
> to
> > > one
> > > > action?
> > > > Thanks in advance!
> > > >
> > > > Tong
> > > >
> > > >
> > > >
> > > >
> __________________________________________________
> > > > Do You Yahoo!?
> > > > Tired of spam?  Yahoo! Mail has the best spam
> > > protection around
> > > > http://mail.yahoo.com
> > > >
> > > >
> > >
> >
>
---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail:
> > > user-help@struts.apache.org
> > > >
> > > >
> > >
> > >
> > >
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail:
> > > user-help@struts.apache.org
> > >
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> >
> >
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org