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 04:13:53 UTC

Help ! Question regarding Action and Form Bean(in detail )!

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