You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by sebb <se...@gmail.com> on 2011/03/09 18:03:01 UTC
Referencing a property which contains "." in its name
If the context contains a property with the name abcd it can be
referenced as $abcd.
I've checked the documentation, but cannot work out how to reference a
property with the name abcd.defg.
Is this possible? If so, how?
Using Velocity 1.5 (Maven site 2.2)
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: Referencing a property which contains "." in its name
Posted by sebb <se...@gmail.com>.
On 9 March 2011 17:47, Nathan Bubna <nb...@gmail.com> wrote:
> On Wed, Mar 9, 2011 at 9:46 AM, Nathan Bubna <nb...@gmail.com> wrote:
>> On Wed, Mar 9, 2011 at 9:31 AM, sebb <se...@gmail.com> wrote:
>>> On 9 March 2011 17:16, Nathan Bubna <nb...@gmail.com> wrote:
>>>> You will have to put the context into itself and do $context.get('abcd.defg')
>>>
>>> OK, thanks, I wondered about using the context.
>>>
>>> However I cannot add the context to the context, because the context
>>> is created somewhere deep in Maven.
>>
>> bummer.
Yes, I'll create a suggestion to enable it.
>>
>>> It would be really useful though as a debugging aid.
>>>
>>> Would there be any point in enhancing the Velocity engine to
>>> optionally self-add the context if e.g. a specific system property was
>>> set?
>>> Or perhaps via a properties file (not so useful with Maven, but
>>> perhaps safer for other usages)?
>>
>> properties file is how pretty much everything else is configured. but
>> i see no reason that both couldn't be supported.
>
> and yes, that would be a useful feature. i like it.
VELOCITY-799
>>>> On Wed, Mar 9, 2011 at 9:03 AM, sebb <se...@gmail.com> wrote:
>>>>> If the context contains a property with the name abcd it can be
>>>>> referenced as $abcd.
>>>>>
>>>>> I've checked the documentation, but cannot work out how to reference a
>>>>> property with the name abcd.defg.
>>>>>
>>>>> Is this possible? If so, how?
>>>>>
>>>>> Using Velocity 1.5 (Maven site 2.2)
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>>>>> For additional commands, e-mail: user-help@velocity.apache.org
>>>>>
>>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>>> For additional commands, e-mail: user-help@velocity.apache.org
>>>
>>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: Referencing a property which contains "." in its name
Posted by Nathan Bubna <nb...@gmail.com>.
On Wed, Mar 9, 2011 at 9:46 AM, Nathan Bubna <nb...@gmail.com> wrote:
> On Wed, Mar 9, 2011 at 9:31 AM, sebb <se...@gmail.com> wrote:
>> On 9 March 2011 17:16, Nathan Bubna <nb...@gmail.com> wrote:
>>> You will have to put the context into itself and do $context.get('abcd.defg')
>>
>> OK, thanks, I wondered about using the context.
>>
>> However I cannot add the context to the context, because the context
>> is created somewhere deep in Maven.
>
> bummer.
>
>> It would be really useful though as a debugging aid.
>>
>> Would there be any point in enhancing the Velocity engine to
>> optionally self-add the context if e.g. a specific system property was
>> set?
>> Or perhaps via a properties file (not so useful with Maven, but
>> perhaps safer for other usages)?
>
> properties file is how pretty much everything else is configured. but
> i see no reason that both couldn't be supported.
and yes, that would be a useful feature. i like it.
>>> On Wed, Mar 9, 2011 at 9:03 AM, sebb <se...@gmail.com> wrote:
>>>> If the context contains a property with the name abcd it can be
>>>> referenced as $abcd.
>>>>
>>>> I've checked the documentation, but cannot work out how to reference a
>>>> property with the name abcd.defg.
>>>>
>>>> Is this possible? If so, how?
>>>>
>>>> Using Velocity 1.5 (Maven site 2.2)
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>>>> For additional commands, e-mail: user-help@velocity.apache.org
>>>>
>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>> For additional commands, e-mail: user-help@velocity.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: Referencing a property which contains "." in its name
Posted by Nathan Bubna <nb...@gmail.com>.
On Wed, Mar 9, 2011 at 9:31 AM, sebb <se...@gmail.com> wrote:
> On 9 March 2011 17:16, Nathan Bubna <nb...@gmail.com> wrote:
>> You will have to put the context into itself and do $context.get('abcd.defg')
>
> OK, thanks, I wondered about using the context.
>
> However I cannot add the context to the context, because the context
> is created somewhere deep in Maven.
bummer.
> It would be really useful though as a debugging aid.
>
> Would there be any point in enhancing the Velocity engine to
> optionally self-add the context if e.g. a specific system property was
> set?
> Or perhaps via a properties file (not so useful with Maven, but
> perhaps safer for other usages)?
properties file is how pretty much everything else is configured. but
i see no reason that both couldn't be supported.
>> On Wed, Mar 9, 2011 at 9:03 AM, sebb <se...@gmail.com> wrote:
>>> If the context contains a property with the name abcd it can be
>>> referenced as $abcd.
>>>
>>> I've checked the documentation, but cannot work out how to reference a
>>> property with the name abcd.defg.
>>>
>>> Is this possible? If so, how?
>>>
>>> Using Velocity 1.5 (Maven site 2.2)
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>>> For additional commands, e-mail: user-help@velocity.apache.org
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: Referencing a property which contains "." in its name
Posted by sebb <se...@gmail.com>.
On 9 March 2011 17:16, Nathan Bubna <nb...@gmail.com> wrote:
> You will have to put the context into itself and do $context.get('abcd.defg')
OK, thanks, I wondered about using the context.
However I cannot add the context to the context, because the context
is created somewhere deep in Maven.
It would be really useful though as a debugging aid.
Would there be any point in enhancing the Velocity engine to
optionally self-add the context if e.g. a specific system property was
set?
Or perhaps via a properties file (not so useful with Maven, but
perhaps safer for other usages)?
> On Wed, Mar 9, 2011 at 9:03 AM, sebb <se...@gmail.com> wrote:
>> If the context contains a property with the name abcd it can be
>> referenced as $abcd.
>>
>> I've checked the documentation, but cannot work out how to reference a
>> property with the name abcd.defg.
>>
>> Is this possible? If so, how?
>>
>> Using Velocity 1.5 (Maven site 2.2)
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>> For additional commands, e-mail: user-help@velocity.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: Referencing a property which contains "." in its name
Posted by Nathan Bubna <nb...@gmail.com>.
You will have to put the context into itself and do $context.get('abcd.defg')
On Wed, Mar 9, 2011 at 9:03 AM, sebb <se...@gmail.com> wrote:
> If the context contains a property with the name abcd it can be
> referenced as $abcd.
>
> I've checked the documentation, but cannot work out how to reference a
> property with the name abcd.defg.
>
> Is this possible? If so, how?
>
> Using Velocity 1.5 (Maven site 2.2)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org