I am using DynaValidatorForm but I need to set the default values for some
text fields in a form. Therefore, I write a ActionForm which extends
DynaValidatorForm and use reset method to set default values. The values
were not shown after the form was loaded.
I must miss something here. Could anyone
This is expected behaviour, when you forward to your second Action Struts
will go through all its normal steps, finding/creating the ActionForm,
populating the form from the request, validating and then calling the
Action's execute method. So setting it to null isn't going to work, you need
to reth
pls,
You won't get an null ActionForm in your Action, you
will just get an empty one. I think because you are
testing for null, you are always populating it from
the DB.
Regards,
Richard
--- pls <[EMAIL PROTECTED]> wrote:
> Hi Richard,
>
>I thought this one would work for sure.. but no
> d
Hi Richard,
I thought this one would work for sure.. but no dice.. the values still
reappear (except for the multiboxes whcih are cleared in the reset() method)
after request.getSession().removeAttribute("MBForm"); and a forward to the
next action.
"Richard Yee" <[EMAIL PROTECTED]> wrote i
pls,
If the form exists in session scope, then you need to
remove it from session using the
request.getSession.removeAttribute() method
call. Otherwise, when the JSP page is executed, struts
will use the form from the session.
Regards,
Richard
--- pls <[EMAIL PROTECTED]> wrote:
> that won't chan
that won't change the form as it exists in session scope, only temporarily
in the action.. thanks anyways
"Kiran Kumar" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> just a guess in ur execute method try this
>
> form = null;
>
>
>
> --- pls <[EMAIL PROTECTED]> wrote:
> > thanks fo
just a guess in ur execute method try this
form = null;
--- pls <[EMAIL PROTECTED]> wrote:
> thanks for the suggestion Amol, but that returns an
> IllegalStateException..
> thanks for trying anyways.
>
>
> "Amol Yadwadkar" <[EMAIL PROTECTED]> wrote in
> message
>
news:[EMAIL PROTECTED]
> > Hi
y, May 14, 2004 10:31 AM
> To: [EMAIL PROTECTED]
> Subject: Re: How to set an ActionForm to null
>
>
> thanks for the suggestion Amol, but that returns an
IllegalStateException..
> thanks for trying anyways.
>
>
> "Amol Yadwadkar" <[EMAIL PROTECTED]> wrote
Has your ActionMappings at Struts-config.xml contains the name of the form
which you are using ?
-Original Message-
From: pls [mailto:[EMAIL PROTECTED]
Sent: Friday, May 14, 2004 10:31 AM
To: [EMAIL PROTECTED]
Subject: Re: How to set an ActionForm to null
thanks for the suggestion
thanks for the suggestion Amol, but that returns an IllegalStateException..
thanks for trying anyways.
"Amol Yadwadkar" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> I havn't tried this but just try this in the execute method :--
> public ActionForward execute(ActionMapping
Hi,
I havn't tried this but just try this in the execute method :--
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest req, HttpServletResponse res) {
...
...
mapping.setAttribute(null);
}
Hope this may help you!!!
--Amol
-Original Message-
F
11 matches
Mail list logo