Ted,

After I sent the original e-mail I found out that one of my developers had
changed where the ActionForm was initially instantiated.  The first JSP is
calling an Action (via a <html:link/> that does NOT have an ActionForm
associated with it.  This Action preloads a series of JavaBeans and then
forwards to the second JSP.  The Action associated with this JSP does have
the ActionForm associated with it, and since the ActionForm has never been
instantiated, the <html:form/> tag was doing it at that time.  I guess I
never realized that the <html:form/> tag would do this (instantiate an
ActionForm and call reset) - I've always been under the impression that the
ActionForm, reset, and validate methods were not called until AFTER the form
was submitted.....

Learning something new everyday ..... 8-)

Thanks.

Jerry Jalenak
Team Lead, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

[EMAIL PROTECTED]


-----Original Message-----
From: Ted Husted [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 19, 2003 6:56 AM
To: Struts Users Mailing List
Subject: Re: ActionForm 'reset' method being called when JSP is rendered


In Struts 1.0.2 and later, reset is called by the html:form tag *if* the 
ActionForm is being instantiated at that time. The scope shouldn't matter.

Also remember that the html:form tag is looking at the Action to which 
it submits, which may not be "Action 1". If these are the same Action, 
or share the same formbean under the same attribute, then the ActionForm 
should already exist, and reset should not be called.

-Ted.

Jerry Jalenak wrote:
> I'm seeing some odd behaviour with one of my actions.  If anyone can
explain
> this I'd sure appreciate it....
> 
> Here's what I've got - in struts-config I have an ActionForm that is
shared
> by two Actions.  The ActionForm is created in session scope by the first
> action, and referenced by the second Action (also in session).  Tracing
the
> calls to 'reset' and 'validate' I see the following:
> 
>       JSP is displayed  -> html form is submitted -> 'reset' is called ->
> 'validate' is called -> Action 1 is performed -> forward to next JSP ->
> 'reset' is called -> JSP is displayed
>       
> /\/\/\/\/\/\/\ !
> 
> My understanding is that 'reset' should not be called again until the form
> on the second JSP is submitted.  Have I completely mis-understood how this
> works?  Or is it something due to the ActionForm being created in session
> scope?
> 
> TIA!
> 
> Jerry Jalenak
> Team Lead, Web Publishing
> LabOne, Inc.
> 10101 Renner Blvd.
> Lenexa, KS  66219
> (913) 577-1496
> 
> [EMAIL PROTECTED]
> 
> 
> This transmission (and any information attached to it) may be confidential
and is intended solely for the use of the individual or entity to which it
is addressed. If you are not the intended recipient or the person
responsible for delivering the transmission to the intended recipient, be
advised that you have received this transmission in error and that any use,
dissemination, forwarding, printing, or copying of this information is
strictly prohibited. If you have received this transmission in error, please
immediately notify LabOne at the following email address:
[EMAIL PROTECTED]
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
Ted Husted,
Struts in Action <http://husted.com/struts/book.html>



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



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

Reply via email to