velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Mueller <>
Subject foreach
Date Wed, 06 Mar 2002 22:50:13 GMT


I am quite probably doing something wrong, however I am really lost :).

I have written a Context descendant, in order to stay independent from
the particular template (want to have the possibility to use the
variables in each HTML template). This context checks in the get
method the given key and returns the particular data. Now I have
a foreach statement in the template, which makes my Context returning
a string array. However it simply does not work. What am I doing wrong?

This is the get method of my own Context.

  public Object get(String key)
    if (key.equals("dummy")) return new String[]{"1","2","3"};

And this is the statement in the HTML template.

<select name="dummy">
 #foreach ($a in $dummy)

Thank you,

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message