Hi Raffael,
I don't understand exactly what's the problem, but I can assure you that it
works. I'm using similar things (classes with quite a few attributes myself
in Vectors, given to velocity) myself frequently.
I sometimes had problems with accessing (public!) attributes, although
according to velocity doc this should work as well. When I accessed the
attribute via a get-method, it worked fine.
Stefan
Am Dienstag, 18. Juni 2002 09:48 schrieben Sie:
> i've tried with a class with two string, but doesnt work, it returns the
> address of the class, and cant go through the strings inside.
>
> ----- Original Message -----
> From: "Stefan Kuhn" <[EMAIL PROTECTED]>
> To: "Jetspeed Users List" <[EMAIL PROTECTED]>
> Sent: Monday, June 17, 2002 6:11 PM
> Subject: Re: Parameters between vm and portlets
>
> > Hi Raffael,
> > you can't iterate over arrays in velocity, is has to be a vector or
>
> something
>
> > similar ("something similar" means a class implementing some interface,
> > collection or so, have a look in velocity doc for that). In your case it
> > should be possible simply to build a vector of java.io.File objects, the
> > class File has got method for getting the name and the path. You can call
> > these methods from your vm files.
> > The other possibility would be to write your own class containing two
>
> strings
>
> > and to put that into the vector .... your choice.
> > Stefan
> >
> > Am Montag, 17. Juni 2002 17:15 schrieben Sie:
> > > I've posted another one fo this, but seems no one read itor mayby i've
> > > wrote it bad, i'll post for the last time.
> > >
> > > I've seen in the sources that you can pass users from a portlet to a vm
> > > file, like that: Criteria criteria = new Criteria();
> > > User [] users = JetspeedSecurity.getUsers (criteria);
> > > context.put("users", users);
> > >
> > > and in the vm i can do like this: $!user.Name etc, accessing records of
>
> the
>
> > > user 'array'.
> > >
> > > now i want to to a similar thing, but with my types, or at least i can
> > > build two arrays, but i dont know how to go through them simultaneously
>
> in
>
> > > vm.
> > >
> > > so, its impossible to build 'records arrays' and i have to use multiple
> > > arrays (and if so how i can use them simultaneously? i know only the
> > > foreach thingy in vm, how works a normal for?) or there is a way? (in
> > > theory should be, if turbine uses this way).
> > >
> > > i'm doing a file listing on multiple dirs, and for each file i want to
> > > separate the path from the filename, doing it in vm file..and from that
>
> the
>
> > > link goes to another portlet that shows the file.
> >
> > --
> > Stefan Kuhn M. A.
> > MPI of Chemical Ecology, Winzerlaer Str. 10, Beutenberg Campus, 07745
> > Jena, Germany
> > Tel: +49(0)3641 571261 - Fax: +49(0)3641 571202
> >
> > --
> > To unsubscribe, e-mail:
>
> <mailto:[EMAIL PROTECTED]>
>
> > For additional commands, e-mail:
>
> <mailto:[EMAIL PROTECTED]>
--
Stefan Kuhn M. A.
MPI of Chemical Ecology, Winzerlaer Str. 10, Beutenberg Campus, 07745
Jena, Germany
Tel: +49(0)3641 571261 - Fax: +49(0)3641 571202
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>