You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "KNOX, Liam, FM" <Li...@rbos.com> on 2002/09/05 16:12:24 UTC
Bug?
I am currently displaying a partially populated list and encountering a few
problems
eg
public void simpleTest() {
List l = new ArrayList();
for (int i = 0; i < 10 ;++i) {
if (i==5) {
l.add(String.valueOf(i));
}
else {
l.add(null);
}
}
// set in velocity context
}
when I display using velocity
i.e
<table>
<!-- #foreach ($s in $strings) -->
<tr><td>value = $!s</td></tr>
<!-- #end -->
</table>
I get the following
value =
value =
value =
value =
value =
value = 5
value = 5
value = 5
value = 5
value = 5
is this a bug??
cheers
Liam
***********************************************************************
Visit our Internet site at http://www.rbsmarkets.com
This e-mail is intended only for the addressee named above.
As this e-mail may contain confidential or privileged information,
if you are not the named addressee, you are not authorised to
retain, read, copy or disseminate this message or any part of it.
The Royal Bank of Scotland is registered in Scotland No 90312
Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB
Regulated by the Financial Services Authority
***********************************************************************
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Bug?
Posted by Cliff Dunn <c....@verizon.net>.
Liam,
This is not a bug, after $s has been set it cannot be set back to null. Try
giving it an invalid value and test if the value has changed in each
itteration of the loop.
see velocity user's guide - Directives section.
http://jakarta.apache.org/velocity/user-guide.html#Directives
Cliff
----- Original Message -----
From: "KNOX, Liam, FM" <Li...@rbos.com>
To: <ve...@jakarta.apache.org>
Sent: Thursday, September 05, 2002 9:12 AM
Subject: Bug?
> I am currently displaying a partially populated list and encountering a
few
> problems
> eg
> public void simpleTest() {
> List l = new ArrayList();
> for (int i = 0; i < 10 ;++i) {
> if (i==5) {
> l.add(String.valueOf(i));
> }
> else {
> l.add(null);
> }
> }
> // set in velocity context
> }
>
> when I display using velocity
> i.e
> <table>
>
> <!-- #foreach ($s in $strings) -->
> <tr><td>value = $!s</td></tr>
> <!-- #end -->
> </table>
>
> I get the following
>
> value =
> value =
> value =
> value =
> value =
> value = 5
> value = 5
> value = 5
> value = 5
> value = 5
>
> is this a bug??
> cheers
> Liam
>
>
>
> ***********************************************************************
> Visit our Internet site at http://www.rbsmarkets.com
>
> This e-mail is intended only for the addressee named above.
> As this e-mail may contain confidential or privileged information,
> if you are not the named addressee, you are not authorised to
> retain, read, copy or disseminate this message or any part of it.
> The Royal Bank of Scotland is registered in Scotland No 90312
> Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB
> Regulated by the Financial Services Authority
> ***********************************************************************
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>