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
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
. the form bean that is instantiated will be empty unless
you put data into it correct?
-Original Message-
From: Jay sissom [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 14, 2002 9:12 PM
To: Struts Users Mailing List
Subject: Re: How to Pre-fill a formbean
The form bean has
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: Jay sissom [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 6:01 AM
To: Struts Users Mailing List
Subject: Re: How to Pre-fill a formbean
You can do it this way, but I would use a Struts tag instead
of a jsp tag.
Instead of using jsp:useBean and jsp:getProperty, all you
,
if it is not in the request/session.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 1:56 PM
To: [EMAIL PROTECTED]
Subject: RE: How to Pre-fill a formbean
Hi All,
And Thanks. So in my loginAction, I can create a reference to mainForm
-Original Message-
From: Nekkalapudi, Viplava [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 12:14 PM
To: 'Struts Users Mailing List'
Subject: RE: How to Pre-fill a formbean
// Create a form with the name given in struts-config.xml
MainForm mainForm = new MainForm
, 2002 4:10 PM
To: 'Struts Users Mailing List'
Subject: RE: How to Pre-fill a formbean
Hi,
In mainAction, where form is passed in by the method header, the code
form.setProperty1(Dog);
compiles.
In loginAction, the code:
MainForm mainForm = new MainForm
To: 'Struts Users Mailing List'
Subject: RE: How to Pre-fill a formbean
Hi,
In mainAction, where form is passed in by the method header, the code
form.setProperty1(Dog);
compiles.
In loginAction, the code:
MainForm mainForm = new MainForm
Hi,
My jsp application begins at a login page.
I call the login page action loginAction and I have defined loginForm to
process the user details.
If the login is successful, the action forwards to mainAction.jsp, whose
form action is /mainAction
Before I display the mainAction.jsp I want to
The form bean has already been created by the time your mainAction perform
method is called if you have defined the form bean in your
struts-config.xml file.
All you would do is this:
mainForm mf = (mainForm)form;
// where form is passed to the perform method
mf.setProperty1(asdfasdf);
,
Phil
-Original Message-
From: Jay sissom [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 14, 2002 6:12 PM
To: Struts Users Mailing List
Subject: Re: How to Pre-fill a formbean
The form bean has already been created by the time your
mainAction perform
method is called if you
To: Struts Users Mailing List
Subject: Re: How to Pre-fill a formbean
The form bean has already been created by the time your mainAction perform
method is called if you have defined the form bean in your
struts-config.xml file.
All you would do is this:
mainForm mf = (mainForm)form;
// where form
, 2002 6:28 PM
To: Struts Users Mailing List
Subject: RE: How to Pre-fill a formbean
How do you know what record in the database this will
retrieve? Where does
it get it's data. the form bean that is instantiated will be
empty unless
you put data into it correct?
-Original Message
14, 2002 6:28 PM
To: Struts Users Mailing List
Subject: RE: How to Pre-fill a formbean
How do you know what record in the database this will
retrieve? Where does
it get it's data. the form bean that is instantiated will be
empty unless
you put data into it correct?
-Original
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
16 matches
Mail list logo