If you only want to use a DynaActionForm, you could use TilesController and 
set the list in the form using BeanUtils.

In you tiles controller get the ActionForm for the module and set the 
corresponding form property.

ActionConfig actionConfig = (ActionConfig)request.getAttribute(
Globals.MAPPING_KEY);
DyanActionForm form = null;
if(StringUtils.equals(actionConfig.getScope(), "request")){
form = (DynaActionForm) request.getAttribute(actionConfig.getAttribute());
} else {
// similarly read from session
}

form.set("optionsCollectionProperty", optionsCollectionProperty); 

Since the tiles controller is always executed just before rendering the jsp, 
you are guaranteed to have the options collection always populated even in 
the "validation failure" case

On 9/14/05, Dylan Stamat <[EMAIL PROTECTED]> wrote:
> 
> I have an Action which sets a populated List in a DynaValidatorForm Bean.
> The "input" of the ActionMapping in the struts-config simply points back 
> to
> the .jsp page (actually a tile def) and uses <html:errors/> to print out 
> the
> error messages.
> 
> If no validation problems occur, there aren't any problems.
> However, if the validation fails, I get an error within the .jsp page
> complaining that my List is null.
> 
> Question:
> 1) The Action populated this List and explicitly set it in the Form 
> Bean...
> so, shouldn't the "input" page have access to this populated field ?
> 
> Answers:
> 1) Yes, I could set the List in the Session, but I'm trying to avoid this.
> 2) I could also use a basic Form Bean instead of a Dyna, but I want to use 
> a
> Dyna.
> 
> 
> This seems like such a simple and common task, but can't for the life of 
> me
> get it to work.
> Any help would be greatly appreciated !
> Thanks !
> ==
> Dylan
> 
>

Reply via email to