I'm assuming you can't change them because someone else created them? There
are still ways you can deal with the beans with sets..
1) Wrap them using the Adapter pattern. However if they are already coming
back nested and you can used the adapters/wrappers in the business layer you
could also..
2) Push them through a conversion utility in the service layer that adds
them to your wrappers/adapters and then use those objects with Lists...

ActivityWrapper {
    EoActivity eoActivity;
    getName() { return eoActivity.getName() }
    List getUsers() { return new ArrayList( eoActivity.getUsersSet() }
    List setUsers(List list) { Set set = new Set();
         set.addAll( list );
         eoActivity.setUsersSet( set );
   }

ActivityUser
  //same thing like above

Unfortunately you're also going to want to use Session scope for the Action
form that holds your "List activittyWrappers" property. You can do it
without using Session scope, but you then add some extra complexity based
off some limitations in Struts1.1. If Request scope is a must, it can be
done though.


On Jan 8, 2008 1:30 PM, jvleminc <[EMAIL PROTECTED]>
wrote:

>
> I know. Unfortunately i can't change my business beans anymore :-( Anyway,
> any other ideas? I am trying now with a EoActivities-conversion.properties
> file, containing
>
> Element_eoActivity = com.datamat.care.bean.EoActivity
> Element_eoUser = com.datamat.care.bean.EoUser
> Element_eoUserAddress = com.datamat.care.bean.EoUserAddress
>
>
> but no avail yet...thanks anyway!
>
>
>
> rickcr wrote:
> >
> > At least in Struts1.1, If I'm not mistaken, you aren't going to be able
> to
> > use indexed properties like you are to set items in a Set. If you use
> > Lists
> > it would be much easier to accomplish the nested collection population.
> >
> > On Jan 8, 2008 1:02 PM, jvleminc <[EMAIL PROTECTED]>
> > wrote:
> >
> >>
> >> Hello,
> >>
> >> I am facing with automatic type conversion upon the submit of my Form:
> >>
> >> Basically I have form fields with the names
> >> eoActivities[0].activityName
> >> eoActivities[0].eoUser[0].eoUserId
> >> eoActivities[0].eoUser[0].eoUserAddress[0].addressType
> >> eoActivities[0].eoUser[0].eoUserAddress[0].name
> >> ...
> >> eoActivities[0].eoUser[0].eoUserAddress[1].addressType
> >> eoActivities[0].eoUser[0].eoUserAddress[1].name
> >> ...
> >> eoActivities[0].eoUser[1].eoUserId
> >> eoActivities[0].eoUser[1].eoUserAddress[0].addressType
> >> eoActivities[0].eoUser[1].eoUserAddress[0].name
> >> ...
> >> eoActivities[1].activityName
> >> eoActivities[1].eoUser[0].eoUserId
> >> eoActivities[1].eoUser[0].eoUserAddress[0].addressType
> >> eoActivities[1].eoUser[0].eoUserAddress[0].name
> >> ...
> >> and so on
> >>
> >> I would like that the values of these form elements are automatically
> >> inserted into the following object:
> >> Set<EoActivity>
> >> with EoActivity a bean with two members variables:
> >>  activityName and Set<EoUser> and appropriate getter and setter,
> >>  with EoUser a bean with two members variables:
> >>    eoUserId and Set<EoUserAddress> and appropriate getter and setter,
> >>    with EoUserAddress a bean with member variables addressType and name
> >>
> >> Is this possible? Right now I receive a lot of
> >> 17:52:32 ERROR [ParametersInterceptor:204] ParametersInterceptor -
> >> [setParameters]: Unexpected Exception caught setting
> >> 'eoActivities[0].eoUser[0].eoUserId' on 'class
> >> com.datamat.care.actions.EoActivitiesAction: Error setting expression
> >> 'eoActivities[0].eoUser[0].eoUserId' with value
> >> '[Ljava.lang.String;@1aa4bb4'
> >>  errors ;-(
> >> Thanks in advance!
> >>
> >> Joris
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Type-conversion-with-Generics-tp14695286p14695286.html
> >> Sent from the Struts - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> > --
> > Rick
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Type-conversion-with-Generics-tp14695286p14695838.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Rick

Reply via email to