You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by ilfrin <il...@poczta.onet.pl> on 2003/10/07 02:26:37 UTC

"$value" when null

Hi ,

  I wonder why it is so,

  in my template the $!profile.FromAddr renders to $value, and all
  other fields of the object hidden under "profile" that are null, I
  thought that the $! will be quiet, that is return a "" in case of a
  null, but it is very loud and returns the bloody $value all the time

  explanations?

-- 
Thanks,
 ilfrin                          mailto:ilfrin@poczta.onet.pl



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


Re: Re[4]: "$value" when null

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
baffling.  Can you send some code demonstrating the problem?  To 
private email would be fine.

On Thursday, October 9, 2003, at 03:27 PM, ilfrin wrote:

> Hi Geir,
>
> 9 października 2003, 19:43:52, zastalo napisane:
>
>
> GMJ> On Tuesday, October 7, 2003, at 06:56 AM, ilfrin wrote:
>
>>> Hi Geir,
>>>
>>> 7 października 2003, 12:52:54, zastalo napisane:
>>>
>>>
>>> GMJ> I don't quite understand.  I assume that you have something 
>>> under
>>> GMJ> 'profile' in the context?  it has a method getFromAddr() or
>>> get(String)
>>> GMJ> that returns null.
>>>
>>> profile is a object (persisted by turque) and getFromAddr() is one of
>>> it's getter methods which returns a null String in some cases (a new
>>> object)
>>>
>>> GMJ> And you see '$value' in the output?
>
> GMJ> Why would '$value' come out?
>
> why would $value come out?
>
> GMJ> if the reference is something other than '$value', then the 
> reference
> GMJ> should print, not the string 'value'
>
> it's $value regardless of the parameter that's calling it
>
> $!profile.getFromAddr()
> $!profile.getName()
>
> it happens when the returning value is null, if it's any string
> including "" the string value is then printed
>
> -- 
> Thanks,
>  ilfrin                            mailto:ilfrin@poczta.onet.pl
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
-- 
Geir Magnusson Jr                                   203-247-1713(m)
geirm@optonline.net


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


Re[4]: "$value" when null

Posted by ilfrin <il...@poczta.onet.pl>.
Hi Geir,

9 października 2003, 19:43:52, zastalo napisane:


GMJ> On Tuesday, October 7, 2003, at 06:56 AM, ilfrin wrote:

>> Hi Geir,
>>
>> 7 października 2003, 12:52:54, zastalo napisane:
>>
>>
>> GMJ> I don't quite understand.  I assume that you have something under
>> GMJ> 'profile' in the context?  it has a method getFromAddr() or 
>> get(String)
>> GMJ> that returns null.
>>
>> profile is a object (persisted by turque) and getFromAddr() is one of
>> it's getter methods which returns a null String in some cases (a new
>> object)
>>
>> GMJ> And you see '$value' in the output?

GMJ> Why would '$value' come out?

why would $value come out?

GMJ> if the reference is something other than '$value', then the reference 
GMJ> should print, not the string 'value'

it's $value regardless of the parameter that's calling it

$!profile.getFromAddr()
$!profile.getName()

it happens when the returning value is null, if it's any string
including "" the string value is then printed

-- 
Thanks,
 ilfrin                            mailto:ilfrin@poczta.onet.pl



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


Re: Re[2]: "$value" when null

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On Tuesday, October 7, 2003, at 06:56 AM, ilfrin wrote:

> Hi Geir,
>
> 7 października 2003, 12:52:54, zastalo napisane:
>
>
> GMJ> I don't quite understand.  I assume that you have something under
> GMJ> 'profile' in the context?  it has a method getFromAddr() or 
> get(String)
> GMJ> that returns null.
>
> profile is a object (persisted by turque) and getFromAddr() is one of
> it's getter methods which returns a null String in some cases (a new
> object)
>
> GMJ> And you see '$value' in the output?

Why would '$value' come out?

if the reference is something other than '$value', then the reference 
should print, not the string 'value'

geir

> yes
>
> -- 
> Thanks,
>  ilfrin                            mailto:ilfrin@poczta.onet.pl
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
-- 
Geir Magnusson Jr                                   203-247-1713(m)
geirm@optonline.net


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


Re[2]: "$value" when null

Posted by ilfrin <il...@poczta.onet.pl>.
Hi Geir,

7 października 2003, 12:52:54, zastalo napisane:


GMJ> I don't quite understand.  I assume that you have something under
GMJ> 'profile' in the context?  it has a method getFromAddr() or get(String) 
GMJ> that returns null.

profile is a object (persisted by turque) and getFromAddr() is one of
it's getter methods which returns a null String in some cases (a new
object)

GMJ> And you see '$value' in the output?
yes

-- 
Thanks,
 ilfrin                            mailto:ilfrin@poczta.onet.pl



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


Re: "$value" when null

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On Monday, October 6, 2003, at 08:26 PM, ilfrin wrote:

> Hi ,
>
>   I wonder why it is so,
>
>   in my template the $!profile.FromAddr renders to $value, and all
>   other fields of the object hidden under "profile" that are null, I
>   thought that the $! will be quiet, that is return a "" in case of a
>   null, but it is very loud and returns the bloody $value all the time


I don't quite understand.  I assume that you have something under 
'profile' in the context?  it has a method getFromAddr() or get(String) 
that returns null.

And you see '$value' in the output?

>
>   explanations?
>
> -- 
> Thanks,
>  ilfrin                          mailto:ilfrin@poczta.onet.pl
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
-- 
Geir Magnusson Jr                                   203-247-1713(m)
geirm@optonline.net


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