You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pat Quinn <pa...@hotmail.com> on 2002/09/11 20:17:25 UTC

Sending parameters to form beans

hi Guys

I'm very new to the world of struts so please excuse me if this seems like a 
really stupid question. Ok my situation is as follows:

I have an action to display some application information, I also have a form 
bean which fetches the data I want to display.

The action takes a user name as a parameter in the request object and then 
set the value in the form bean in order to display the data for that user. 
But the reset method is called on the form bean and clears the contents of 
the form bean.

How should i implement this?


_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Sending parameters to form beans

Posted by Michael Lee <ml...@hotmail.com>.
Ya, you go out and read his book, or you can do this;

    <bean:message key="prompt.username"/>
    <bean:write name="userForm" property="userID"/>
    <html:hidden property="userID"/>

I prefer to just get my answers in 5 minutes rather than read a whole book
to get the answer.
This is cut and pasted from my actual app.
The only other way is to put it in the session or add it to a URL request
such as http://domain.com/strutsaction/something.do&userID=Bob.
You can't put it in to the request because it doesn't exist yet.
(I just asked this question yesterday). Got some answers but no one really
said this. I just figured this out. Seems obvious now, but not when your
coding it up.
Mike

----- Original Message -----
From: "Eddie Bush" <ek...@swbell.net>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, September 11, 2002 3:56 PM
Subject: Re: Sending parameters to form beans


> Pat, go read Chuck's book.  I notice someone else gave you a pointer to
> it too.  There is a *wealth* of information to be had there.  For (some
> of) the trickier points, hit Ted's site over at http://husted.com/struts
> -- and, specifically http://husted.com/struts/tips (copy and paste,
> pragmatic solutions).
>
> Please reserve asking questions for the time after you've actually read
> Chuck's book ... and tinkered with the "Struts machinery".  Just reading
> that one book will explain *so* much to you!  Tinkering required for
> good understanding though - don't be scared to shed some blood ... erm
> ... get your hands dirty! ;-)
>
> Regards,
>
> Eddie
>
> Pat Quinn wrote:
>
> > hi Guys
> >
> > I'm very new to the world of struts so please excuse me if this seems
> > like a really stupid question. Ok my situation is as follows:
> >
> > I have an action to display some application information, I also have
> > a form bean which fetches the data I want to display.
> >
> > The action takes a user name as a parameter in the request object and
> > then set the value in the form bean in order to display the data for
> > that user. But the reset method is called on the form bean and clears
> > the contents of the form bean.
> >
> > How should i implement this?
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Sending parameters to form beans

Posted by Eddie Bush <ek...@swbell.net>.
Pat, go read Chuck's book.  I notice someone else gave you a pointer to 
it too.  There is a *wealth* of information to be had there.  For (some 
of) the trickier points, hit Ted's site over at http://husted.com/struts 
-- and, specifically http://husted.com/struts/tips (copy and paste, 
pragmatic solutions).

Please reserve asking questions for the time after you've actually read 
Chuck's book ... and tinkered with the "Struts machinery".  Just reading 
that one book will explain *so* much to you!  Tinkering required for 
good understanding though - don't be scared to shed some blood ... erm 
... get your hands dirty! ;-)

Regards,

Eddie

Pat Quinn wrote:

> hi Guys
>
> I'm very new to the world of struts so please excuse me if this seems 
> like a really stupid question. Ok my situation is as follows:
>
> I have an action to display some application information, I also have 
> a form bean which fetches the data I want to display.
>
> The action takes a user name as a parameter in the request object and 
> then set the value in the form bean in order to display the data for 
> that user. But the reset method is called on the form bean and clears 
> the contents of the form bean.
>
> How should i implement this? 




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>