struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stéphane Zuckerman <stephane.zucker...@gmail.com>
Subject Re: LazyLists and dynamic forms
Date Tue, 12 Apr 2005 08:11:49 GMT
Hello, and sorry for the late answer...

Niall Pemberton a écrit :
> What you have looks OK to me - except in the Action the reference to
> DynaValidatorForm - looks like your referencing the wrong class to me - 

You're right, I just mistyped it, but it is a BeanValidatorForm.

> the
> actual ActionForm flavour should be a BeanValidatorForm - but IMO its better
> to just cast it to a DynaBean, then your not fixed on an implementation.
> 
> Something like...
> 
> public final class DynaLazyAction extends Action {
> 
>     public ActionForward execute(...) {
> 
>         DynaBean dynaForm = (DynaBean) form;
>         // here is the line that makes it all crumble...
>         Person[] persons = (Person[]) dynaForm.get("persons");
> 
>         request.setAttribute("persons",persons);
>         return mapping.findForward("ok");
>     }
> }
> 
> Also when you say "here is the line that makes it all crumble" - what does
> that mean? Presumably your getting an Exception thrown - if so, what is it?


The exception is a ClassCastException ... Which is really strange, since 
the bean is supposed to store exactly the object I'm trying to retrieve ...

Thanks for your answers ! :-)

-- 
Stéphane Zuckerman

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


Mime
View raw message