You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Steven Santiago <sm...@neca.com> on 2003/04/29 17:31:25 UTC

Where to store collection when using DynaValidatorForm?

My validation works properly except the collection set on my form which
is of type org.apache.struts.validator.DynaValidatorForm is not present
when the page fails validation. This is not an issue if I simple set the
collection in the session.

[snip]
session.setAttribute("dxCodeCategories", dxCodeCategories);

I do not really want to store this in the session when I should be able
to do something like:

DynaValidatorForm dxCodeForm = (DynaValidatorForm)form;
dxCodeForm.set("dxCodeCategories", dxCodeCategories);

in the Action that I use to set this .jsp initially. The above works
when initially displaying my .jsp but not for when validation fails. I
have my form defined like this:

<form-bean name="CodeSearchForm"
type="org.apache.struts.validator.DynaValidatorForm" dynamic="true">
<form-property name="codeDescription"   type="java.lang.String" />
<form-property name="codeName"          type="java.lang.String"/>	
<form-property name="dxCodeCategories"  type="java.util.ArrayList" />
</form-bean>

Am I doing something incorrectly? I'm curious how others handle this.

Thanks,

steve






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