The implementation of reset in ActionForm is empty. Overriding reset in your
descendants to do nothing will have no effect.

Paul

-----Original Message-----
From: David Chelimsky [mailto:[EMAIL PROTECTED]
Sent: 01 August 2003 14:34
To: Struts Users Mailing List
Subject: Re: Formbean Scope


Even if you don't write a reset method, the ActionForm's reset method is
called on every request. Your only option (that I'm aware of) is to override
it:

public void reset(ActionMapping mapping, HttpServletRequest request) {}

This will cause reset to do nothing and all your values will remain in tact.
If you need a means of clearing these out, you'll have to add another method
that you can call from Action1, for example:

public void clearForm() {
    property1 = null;
    //etc.....
}

This is because Struts always calls reset on every request, regardless of
bean scope.





----- Original Message ----- 
From: "Goldy J" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Friday, August 01, 2003 8:18 AM
Subject: Re: Formbean Scope


> Thanks a lot David for the prompt reply . Iam actually not using reset
method. I have couple of text fields and combobox in JSP2 which I need to
prepopulate from JSP1. Do you still recommend using reset or there is any
other way. If you can refer to any working example it would be great. 
> Thanks
> 
> David Chelimsky <[EMAIL PROTECTED]> wrote:
> Try overriding reset() such that it doesn't do anything. Otherwise, the
> reset() method in ActionForm will set all primitives to their defaults and
> all objects to null.
> 
> 
> ----- Original Message -----
> From: "Goldy J" 
> To: 
> Sent: Friday, August 01, 2003 7:20 AM
> Subject: Formbean Scope
> 
> 
> > Hello,
> > I have JSP1 from which I go to JSP2. The JSP2 should come prepopulated
> with some values that I set in action class associated with JSP1. I am
> using the same formbean for both JSP 1 and JSP 2. I set the value that I
> need in JSP2 in Action class1 and I can see they are getting set in the
> formbean. But when JSP2 open the get method shows value as null. In action
> mapping the scope is session.
> > I suppose that Iam losing the formbean when the JSP2 opens ..is there a
> way out ?
> > Pls. help
> >
> > Thanks
> >
> >
> > ---------------------------------
> > Do you Yahoo!?
> > SBC Yahoo! DSL - Now only $29.95 per month!
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> ---------------------------------
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!


**************************************
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.


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

Reply via email to