You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Vic <vi...@friendvu.com> on 2005/02/13 01:28:39 UTC

ot: LazyDynaMap

This looks very nice! I plan to use it w/ JDNC.

It be nice to have a DynaList. It would be an indexed ArrayList of 
ListDynaMaps.

So from iBatis I can return an ArrayList of Maps as DTO and .... just 
map it.
.V

Niall Pemberton wrote:

>You could use a LazyDynaMap to do this (with Struts 1.2.4). LazyDynaMap is a
>"wrapper" for a Map. Because its not an ActionForm Struts will wrap it in a
>BeanValidatorForm, which you can use with Validator.
>
>Just specify it in the struts-config.xml for your form.
>
><form-bean name="mapForm" type="org.apache.commons.beanutils.LazyDynaMap"/>
>
>In your action you can get the actual Map in the following way...
>
>    LazyDynaMap dynaMap = ((BeanValidatorForm)form).getInstance();
>    Map myMap = dynaMap.getMap();
>
>  
>


-- 
Forums, Boards, Blogs and News in RiA <http://www.boardVU.com>


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


Re: LazyDynaMap

Posted by Vic <vi...@friendvu.com>.
Not in my case:
- I use this outside of Sturts :-P
- iBatis uses ArrayList ... not []

I am sure I can do something based on commons beans code for me, but it 
be nice to have it in the jar.

.V

Niall Pemberton wrote:

>Would specifying an array of LazyDynaMap in the struts-config.xml do what
>you want?
>
>  
>
>>It be nice to have a DynaList. It would be an indexed ArrayList of
>>ListDynaMaps.
>>
>>So from iBatis I can return an ArrayList of Maps as DTO and .... just
>>map it.
>>.V
>>
>>    
>>

-- 
Forums, Boards, Blogs and News in RiA <http://www.boardVU.com>


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


Re: LazyDynaMap

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
Would specifying an array of LazyDynaMap in the struts-config.xml do what
you want?

<form-bean type="org.apache.commons.beanutils.LazyDynaMap">
     <form-property name="xyz"
type="org.apache.commons.beanutils.LazyDynaMap[]"/>
</form-bean>

Niall

----- Original Message ----- 
From: "Vic" <vi...@friendvu.com>
To: <us...@struts.apache.org>
Sent: Sunday, February 13, 2005 12:28 AM
Subject: ot: LazyDynaMap


> This looks very nice! I plan to use it w/ JDNC.
>
> It be nice to have a DynaList. It would be an indexed ArrayList of
> ListDynaMaps.
>
> So from iBatis I can return an ArrayList of Maps as DTO and .... just
> map it.
> .V
>
> Niall Pemberton wrote:
>
> >You could use a LazyDynaMap to do this (with Struts 1.2.4). LazyDynaMap
is a
> >"wrapper" for a Map. Because its not an ActionForm Struts will wrap it in
a
> >BeanValidatorForm, which you can use with Validator.
> >
> >Just specify it in the struts-config.xml for your form.
> >
> ><form-bean name="mapForm"
type="org.apache.commons.beanutils.LazyDynaMap"/>
> >
> >In your action you can get the actual Map in the following way...
> >
> >    LazyDynaMap dynaMap = ((BeanValidatorForm)form).getInstance();
> >    Map myMap = dynaMap.getMap();



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