Re: Does nVelocity only support Spaces, Double\Singe Quotes before\after properties?

13 views
Skip to first unread message

Jonathon Rossi

unread,
Nov 14, 2012, 10:48:02 AM11/14/12
to castle-pro...@googlegroups.com
Just use curly braces. e.g. ${variable}

See the Velocity syntax reference:
http://velocity.apache.org/engine/devel/vtl-reference-guide.html

On Thu, Nov 15, 2012 at 12:58 AM, gBurgur <gbu...@gmail.com> wrote:
Does nVelocity only support Spaces, Double\Singe Quotes before\after properties?

TEMPLATE:
ASMXWSName (space\CrLF)  : $clsNVBasics.ASMXWSName
ASMXWSName (space\space) : XXX $clsNVBasics.ASMXWSName XXXX   
ASMXWSName (DoubleQuotes): "$clsNVBasics.ASMXWSName"   
ASMXWSName (SingleQuotes): '$clsNVBasics.ASMXWSName'   
ASMXWSName (Undersocres) : _$clsNVBasics.ASMXWSName_   
ASMXWSName (xxx\xxx)     : XXX$clsNVBasics.ASMXWSNameXXXX  

OUTPUT:
ASMXWSName (space\CrLF)  : myWebservice                    << works
ASMXWSName (space\space) : XXX myWebservice XXXX           << works 
ASMXWSName (DoubleQuotes): "myWebservice"                  << works
ASMXWSName (SingleQuotes): 'myWebservice'                  << works
ASMXWSName (Undersocres) : _$clsNVBasics.ASMXWSName_       << doesn't work
ASMXWSName (xxx\xxx)     : XXX$clsNVBasics.ASMXWSNameXXXX  << doesn't work  

I have been using nVelocity for HTML email generation for a few of years with no problems.  It is hard to believe I never notice this before.

I am trying to generate program code for web services (JavaScript\jQuery and C# backend).  I noticed that nVelocity does not fill-in the $variables if there is TEXT before\after the variables.  It works fine for Spaces & Double\Singe Quotes.

Is there some setting\property that can be set to allow for XXX$VariableXXX?

Thanks,
Gene

--
You received this message because you are subscribed to the Google Groups "Castle Project Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/castle-project-users/-/N0UGI-qHRiwJ.
To post to this group, send email to castle-pro...@googlegroups.com.
To unsubscribe from this group, send email to castle-project-u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.



--
Jono

gBurgur

unread,
Nov 14, 2012, 12:11:07 PM11/14/12
to castle-pro...@googlegroups.com
Thanks very much for the quick answer.

It is hard to believe I never ran into this for email templates so I was looking at quite a few of the email templates and HTML attributes all have quotes around them while the formal parts of the email (i.e. To: $className.FirstName ) never run into this problem.

Again, thanks so much.

Gene

Reply all
Reply to author
Forward
0 new messages