You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ym...@mousquetaires.com on 2004/10/04 15:06:19 UTC

Struts actionForm modification problem...

Hi,
I'm using Struts 1.1 and I encounter a strange problem with actionForm
instance.
I'm new on this list and I 'll try to be clear...

I have a JSP Form that point to a DispatchAction that forward the request
to another Action Class according to his parameter.
Among the 4 action classes I have a CreateAction that save my form data
into my database and forward the control to another Action that have to
reset my Form (scope:session for all Action classes). Behind this Action I
have 2 other Action and finally my JSP Form (normally blank).

But in fact all modifications of my ActionForm I do inside my InitAction
aren't taken. When I came back on my jsp form, I always have my inital
values that have been saved into my database.
Even I tried to manually set the form session attribute to null and nothing
changes...
It seems that Struts keep my  first form instance elsewhere and replace it
on my modification  in the last Action that forward to my jsp...

I really don't understand this behaviour and if someone has some
informations it's more than wellcome.

Thanks,
Yves-Marie





***************************************************************************** 
Tout usage de ce message par une personne autre que son destinataire 
est strictement interdit. L'integrite de ce message n'etant pas assuree 
sur Internet, Le groupement des Mousquetaires ne peut etre tenu responsable 
de son contenu. 
Toute utilisation ou diffusion non autorisee est interdite. Si vous 
n'etes pas destinataire de ce message, merci de le detruire et d'avertir 
l'expediteur 
*****************************************************************************  

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Struts actionForm modification problem...

Posted by "David G. Friedman" <hu...@ix.netcom.com>.
Yves-Marie,

I think I have read on the list that chaining actions (without using
redirect="true", so the client never receives a redirect and all forwarding
is internal) causes each action to reparse the request, which should
re-populate the ActionForm with the original request data.  Perhaps a better
technique would be to put an object in Session scope, populate it once with
request data, then in each Action, if the object exists in Session scope -
use it - otherwise create it and populate it so other steps can use the
request data.

OR, you could try the struts-chains, setup your own chains, and a step in
the main process to forward to the appropriate chain.  But, since the
documentation is light on that project, I'm wouldn't recommend it (yet).

Regards,
David

-----Original Message-----
From: ymlaine@mousquetaires.com [mailto:ymlaine@mousquetaires.com]
Sent: Monday, October 04, 2004 9:06 AM
To: user@struts.apache.org
Subject: Struts actionForm modification problem...



Hi,
I'm using Struts 1.1 and I encounter a strange problem with actionForm
instance.
I'm new on this list and I 'll try to be clear...

I have a JSP Form that point to a DispatchAction that forward the request
to another Action Class according to his parameter.
Among the 4 action classes I have a CreateAction that save my form data
into my database and forward the control to another Action that have to
reset my Form (scope:session for all Action classes). Behind this Action I
have 2 other Action and finally my JSP Form (normally blank).

But in fact all modifications of my ActionForm I do inside my InitAction
aren't taken. When I came back on my jsp form, I always have my inital
values that have been saved into my database.
Even I tried to manually set the form session attribute to null and nothing
changes...
It seems that Struts keep my  first form instance elsewhere and replace it
on my modification  in the last Action that forward to my jsp...

I really don't understand this behaviour and if someone has some
informations it's more than wellcome.

Thanks,
Yves-Marie





****************************************************************************
*
Tout usage de ce message par une personne autre que son destinataire
est strictement interdit. L'integrite de ce message n'etant pas assuree
sur Internet, Le groupement des Mousquetaires ne peut etre tenu responsable
de son contenu.
Toute utilisation ou diffusion non autorisee est interdite. Si vous
n'etes pas destinataire de ce message, merci de le detruire et d'avertir
l'expediteur
****************************************************************************
*

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org