You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Laurie Harper <la...@holoweb.net> on 2008/03/18 15:33:17 UTC

Re: Struts 1.3 : DynaValidatorActionForm missing input form data on errors display

eod wrote:
> Hi,
> 
> I'm seeing input form data disappear if the validation fails & the page is
> re-displayed; have Googled around but found nothing specific to dyna forms,
> so I'm hoping someone has come across this & know what the issue is; I had
> tried setting the action's scope to session as a test, but the form data
> still disappears.
> 
> The form is declared as a DynaValidatorActionForm b/c I hope to re-use it in
> later actions.
> I'm using an initial setup action w/ validation off which forwards to the
> page in question that captures user data.
> 
> Thanks in advance for any help.
> 
> Here are the relevant form, actions & validation declarations :
> 
> struts-config.xml :
> 
> 		<form-bean name="shippingBillingAddressForm"
> type="org.apache.struts.validator.DynaValidatorActionForm">		
>          <form-property name="firstName" type="java.lang.String" />
>          <form-property name="lastName" type="java.lang.String" />
>          <form-property name="address1" type="java.lang.String" />
>          <form-property name="address2" type="java.lang.String" />
>          <form-property name="city" type="java.lang.String" />
>          <form-property name="state" type="java.lang.String" />
>          <form-property name="zip" type="java.lang.String" />
>          <form-property name="phone" type="java.lang.String" />
>          <form-property name="shipping" type="java.lang.String" />           
>         </form-bean>
> 
> 		<!--  setup action that navigates to the shipping page; existance
> 				is solely to render the initial shipping page w/o validaton errors
> showing -->
> 		<action path="/shippingSetup" name="shippingBillingAddressForm"
> 				input="shipping.page"												
> 				validate="false"
> 				scope="request">
> 			<forward name="toShipping" path="shipping.page"/>
>         </action>
> 		<action path="/shipping" name="shippingBillingAddressForm"
> 				input="shipping.page"												
> 				validate="true"
> 				scope="request">
> 			<forward name="toBilling" path="billing.page"/>
>         </action>
> 
> validation.xml :
> 
>     <formset>
> 
> 		<form name="/shipping">
>             <field property="firstName" depends="required">
>             <arg0 key="addressForm.firstName"/>	
>             </field>
> 		</form>
> ....

What does shipping.page refer to? A Tiles definition? The 'input' 
attribute of your form handling action should probably point back to the 
setup action.

L.


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