You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by sqdf qsdf <po...@yahoo.fr> on 2004/10/26 17:59:32 UTC

Backup ActionForm on ActionError in Action

Hi all!

When I add an ActionError in the validate method of
ActionForm, I don't have any problem, my form is
backup and when I come back to my JSP, I can see all
form's datas. When I add an ActionError in the execute
method of Action, and make the call for saveError(), I
loose all form's datas when I come back to my JSP. 

Somebody knows ?

Nicolas




	

	
		
Vous manquez d’espace pour stocker vos mails ? 
Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis. A télécharger gratuitement sur http://fr.messenger.yahoo.com

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


Re: Backup ActionForm on ActionError in Action

Posted by Jeff Beal <jb...@webmedx.com>.
This is normal behavior.  The reset method is only to clear the values 
of checkbox fields, not to set all fields in the form to initial values. 
  Read the JavaDoc on the ActionForm.reset() method for an explanation.

-- Jeff

sqdf qsdf wrote:
>  I tested the redirect set false but I don't know why,
> the ActionForm is always reset at the end of the
> execute method.


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


Re: Backup ActionForm on ActionError in Action

Posted by sqdf qsdf <po...@yahoo.fr>.
Thank you for your help!!!

 I tested the redirect set false but I don't know why,
the ActionForm is always reset at the end of the
execute method.

My Struts Config is like this :


<form-bean name="ContactForm"
type="com.xxxxx.gui.wif.directory.ContactForm"/>

<action path="/action/directory/createContact"

type="com.xxxxx.gui.wif.directory.CreateContactAction"
	scope="session"
	input="contactCreate"
	name="ContactForm"
	redirect="false">
	<forward name="success"             
path="contactCreate"/>
</action>	

My ContactForm extends ValidatorForm and I use the
tiles to define the path contactCreate.

When I place this in my reset method :
        System.out.println("RESET");
I can see in my logs :

RESET (before the execute method)
RESET (after the execute method)

Every help is welcome!
Thanks!

Nicolas

 > Andrew Hill <an...@gridnode.com>
wrote : 
> Sounds like the forward you are returning from your
> execute is 
> redirecting and hence you get a new request object.
> Check your struts 
> config to make sure it says redirect="false" and not
> true for that forward.
> 
> sqdf qsdf wrote:
> 
> > Hi all!
> > 
> > When I add an ActionError in the validate method
> of
> > ActionForm, I don't have any problem, my form is
> > backup and when I come back to my JSP, I can see
> all
> > form's datas. When I add an ActionError in the
> execute
> > method of Action, and make the call for
> saveError(), I
> > loose all form's datas when I come back to my JSP.
> 
> > 
> > Somebody knows ?
> > 
> > Nicolas
> > 
> > 
> > 
> > 
> > 	
> > 
> > 	
> > 		
> > Vous manquez d’espace pour stocker vos mails ? 
> > Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
> > Créez votre Yahoo! Mail sur
> http://fr.benefits.yahoo.com/
> > 
> > Le nouveau Yahoo! Messenger est arrivé ! Découvrez
> toutes les nouveautés pour dialoguer instantanément
> avec vos amis. A télécharger gratuitement sur
> http://fr.messenger.yahoo.com
> > 
> >
>
---------------------------------------------------------------------
> > 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
> 
>  


	

	
		
Vous manquez d’espace pour stocker vos mails ? 
Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis. A télécharger gratuitement sur http://fr.messenger.yahoo.com

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


Re: Backup ActionForm on ActionError in Action

Posted by Andrew Hill <an...@gridnode.com>.
Sounds like the forward you are returning from your execute is 
redirecting and hence you get a new request object. Check your struts 
config to make sure it says redirect="false" and not true for that forward.

sqdf qsdf wrote:

> Hi all!
> 
> When I add an ActionError in the validate method of
> ActionForm, I don't have any problem, my form is
> backup and when I come back to my JSP, I can see all
> form's datas. When I add an ActionError in the execute
> method of Action, and make the call for saveError(), I
> loose all form's datas when I come back to my JSP. 
> 
> Somebody knows ?
> 
> Nicolas
> 
> 
> 
> 
> 	
> 
> 	
> 		
> Vous manquez d’espace pour stocker vos mails ? 
> Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
> Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
> 
> Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis. A télécharger gratuitement sur http://fr.messenger.yahoo.com
> 
> ---------------------------------------------------------------------
> 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