Subject: Re: How to Pre-fill a formbean
From: "Pim" <[EMAIL PROTECTED]>
 ===
This is exactly the answer I had in mind, except for the part to use class
instead of type, I didn't know that. Casting your original loginForm to a
mainForm won't work, you have to explicitly create a new mainForm and
populate it.

Pim
"Lee Joe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Phil,
>
> Your loginAction should create and populate a mainForm
> bean and then saves it in the request scope. In the
> main.jsp, get a reference to this form by:
> <jsp:useBean name="mainForm" scope="request"
> class="com.MainForm">
> and the input fields on that jsp get the defaults from
> this form bean. You have to use class (not type) so
> that if you come from a differene route to main.jsp
> rather than Login and the mainform bean may not be
> there already, a new one will be created for u. Then
> your jsp won't bombs and the input fields still get
> blank defaults.
>
> - Joe
>
> RE: How to Pre-fill a formbean
>
> --------------------------------------------------------------------------
------
>
>
> From: HERSHKOWITZ,PHIL (A-Sonoma,ex1)
> Subject: RE: How to Pre-fill a formbean
> Date: Thu, 14 Mar 2002 18:14:30 -0800
>
> --------------------------------------------------------------------------
------
>
>
> Hi,
>
> >From the loginAction, I am calling the database to
> retrieve default values
> for some of the fields the use must fill out on
> mainAction.jsp. The default
> values depend on the user ID.
>
> Phil
>
>
>
> _________________________________________________________________
> 使用全球最多人使用的電子郵件服務 MSN Hotmail,請移至
http://www.hotmail.com
> 。
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to