Thanks.  I found that myself along with scala-javautils in github by
Jorge Ortiz which helps out with the converting from Scala collections
to Java ones.

The @BeanProperty annotation works fine for val and vars but is not
helpful if your passing around mapper instances where the attribs/
props are objects.  Of course passing a mapper instance to a 3rd party
lib is probably not a good idea anyway so my solution is to add a toDto
() to my class which creates an immutable data transfer object or
value object from its state which when passed into velocity (with
@BeanProperty annotations) works as expected.

Thanks again.

On Jul 9, 10:16 pm, Marc Boschma <[email protected]> wrote:
> I think your right - see
>
> http://www.scala-lang.org/docu/files/api/scala/reflect/BeanProperty.html
> andhttp://scala.sygneca.com/code/defining-bean-properties
>
> for how to add the annotations to the classes for Velocity to be able  
> to see the properties...
>
> Marc
>
> On 10/07/2009, at 3:04 AM, Ewan wrote:
>
>
>
> > Bit of googling and came across some wicket/scala folks having a
> > similar problem who got around the problem with the following:
>
> >  implicit def listToJavaList[T](l: Seq[T]) = l.foldLeft(new
> > java.util.ArrayList[T](l.size)){(al, e) => al.add(e); al}
>
> > and magically I can pull out the value now.  What I can't do now are
> > pull out an object's properties for example:
>
> > #foreach($user in $headers.users)
> >    hello $user.firstname $user.lastname
> > #end
>
> > I reckon the problem is that Velocity must use bean introspection and
> > without getters I can't get the values.
>
> > --Ewan
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to