You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by christoph sturm <ch...@schaumwelt.com> on 2004/03/16 18:54:38 UTC

strange bahevior with #

hey all!

i have this vtl snippet:

        div#${portlet.name}Main

portlet.name = "admin"

and it resolves to:
        div#admin#ain
instead of
        div#adminMain

is this a bug, or do i need to escape something?

thanks
 chris


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


Re: strange bahevior with #

Posted by Geir Magnusson Jr <ge...@4quarters.com>.
On Mar 17, 2004, at 10:48 PM, Cort Schaefer wrote:

> Does this mean I did a good job porting -- I even ported the bugs?

Yes - excellent job!

LOL

geir

>
> Cort
>
> -----Original Message-----
> From: Geir Magnusson Jr [mailto:geir@4quarters.com]
> Sent: Wednesday, March 17, 2004 11:38 AM
> To: Velocity Users List
> Subject: Re: strange bahevior with #
>
>
> On Mar 16, 2004, at 12:54 PM, christoph sturm wrote:
>
>> hey all!
>>
>> i have this vtl snippet:
>>
>>        div#${portlet.name}Main
>>
>> portlet.name = "admin"
>>
>> and it resolves to:
>>        div#admin#ain
>> instead of
>>        div#adminMain
>>
>> is this a bug, or do i need to escape something?
>
> That's a bug.  A really weird one.
>
> As a workaround do this
>
> #set($hash = '#')
>
> div$hash${portlet.name}Main
>
>>
>> thanks
>> chris
>>
>>
>> ---------------------------------------------------------------------
>> 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)
> geir@4quarters.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
>
>
>
>
> ---------------------------------------------------------------------
> 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)
geir@4quarters.com


-- 
Geir Magnusson Jr                                   203-247-1713(m)
geir@4quarters.com


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


Re: strange bahevior with #

Posted by Geir Magnusson Jr <ge...@4quarters.com>.
On Mar 18, 2004, at 9:16 AM, Mike Curwen wrote:

> Apparently. I can confirm it exists with the 1.3.1 java release of
> Velocity. (In case the original poster was using .NET)

That's what I did when I agreed it was a bug - tested it first, and 
it's a weird one :)

>
>> -----Original Message-----
>> From: Cort Schaefer [mailto:cort@xmission.com]
>> Sent: Wednesday, March 17, 2004 9:49 PM
>> To: 'Velocity Users List'
>> Subject: RE: strange bahevior with #
>>
>>
>> Does this mean I did a good job porting -- I even ported the bugs?
>>
>> Cort
>>
>
>
> ---------------------------------------------------------------------
> 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)
geir@4quarters.com


-- 
Geir Magnusson Jr                                   203-247-1713(m)
geir@4quarters.com 
                                  


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


RE: strange bahevior with #

Posted by Mike Curwen <gb...@gb-im.com>.
Apparently. I can confirm it exists with the 1.3.1 java release of
Velocity. (In case the original poster was using .NET)

> -----Original Message-----
> From: Cort Schaefer [mailto:cort@xmission.com] 
> Sent: Wednesday, March 17, 2004 9:49 PM
> To: 'Velocity Users List'
> Subject: RE: strange bahevior with #
> 
> 
> Does this mean I did a good job porting -- I even ported the bugs?
> 
> Cort
> 


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


RE: strange bahevior with #

Posted by Cort Schaefer <co...@xmission.com>.
Does this mean I did a good job porting -- I even ported the bugs?

Cort

-----Original Message-----
From: Geir Magnusson Jr [mailto:geir@4quarters.com] 
Sent: Wednesday, March 17, 2004 11:38 AM
To: Velocity Users List
Subject: Re: strange bahevior with #


On Mar 16, 2004, at 12:54 PM, christoph sturm wrote:

> hey all!
>
> i have this vtl snippet:
>
>        div#${portlet.name}Main
>
> portlet.name = "admin"
>
> and it resolves to:
>        div#admin#ain
> instead of
>        div#adminMain
>
> is this a bug, or do i need to escape something?

That's a bug.  A really weird one.

As a workaround do this

#set($hash = '#')

div$hash${portlet.name}Main

>
> thanks
> chris
>
>
> ---------------------------------------------------------------------
> 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)
geir@4quarters.com


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






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


Re: strange bahevior with #

Posted by Geir Magnusson Jr <ge...@4quarters.com>.
On Mar 16, 2004, at 12:54 PM, christoph sturm wrote:

> hey all!
>
> i have this vtl snippet:
>
>        div#${portlet.name}Main
>
> portlet.name = "admin"
>
> and it resolves to:
>        div#admin#ain
> instead of
>        div#adminMain
>
> is this a bug, or do i need to escape something?

That's a bug.  A really weird one.

As a workaround do this

#set($hash = '#')

div$hash${portlet.name}Main

>
> thanks
> chris
>
>
> ---------------------------------------------------------------------
> 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)
geir@4quarters.com


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


Re: strange bahevior with #

Posted by Mike Kienenberger <mk...@alaska.net>.
christoph sturm <ch...@schaumwelt.com> wrote:
> hey all!
> 
> i have this vtl snippet:
> 
>         div#${portlet.name}Main
> 
> portlet.name = "admin"
> 
> and it resolves to:
>         div#admin#ain
> instead of
>         div#adminMain
> 
> is this a bug, or do i need to escape something?

You're not using the .NET port of velocity, are you?
This looks similar to a bug someone posted on that (non-associated) product.

What you have listed above looks perfectly correct.

One thing you can try (and that will probably work) is to escape the #.

Ie,

#set ($poundSign = '#')
div${poundSign}${portlet.name}Main

I believe this was also the fix for the other .NET port problem.

-Mike

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