velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cliff Dunn" <c.du...@verizon.net>
Subject Re: Bug?
Date Fri, 06 Sep 2002 16:21:23 GMT
Liam,

Don't know for sure,  guessing it the old problem with HashMap and nulls.
Maybe since the context is nothing but a HashMap,  the engine can't tell the
difference between missing object and an object whose value is null.  To
avoid this confusion maybe the authors decided to test this condition by
enforcing a dummy value in order to make the distinction.

Cliff
----- Original Message -----
From: "KNOX, Liam, FM" <Liam.Knox@rbos.com>
To: "'Velocity Users List'" <velocity-user@jakarta.apache.org>
Sent: Friday, September 06, 2002 3:38 AM
Subject: RE: Bug?


> What is the reasoning on not being able to assign a
> variable to null?
>
> -----Original Message-----
> From: Cliff Dunn [mailto:c.dunn5@verizon.net]
> Sent: 05 September 2002 17:35
> To: Velocity Users List
> Subject: Re: Bug?
>
>
> 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" <Liam.Knox@rbos.com>
> To: <velocity-user@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:
> <mailto:velocity-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:velocity-user-help@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
> <mailto:velocity-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:velocity-user-help@jakarta.apache.org>
>
>
> ********************************************************************
>       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:
<mailto:velocity-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:velocity-user-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message