Questions tagged [nvelocity]

NVelocity is a port of the Apache Jakarta Velocity project. It is a simple, easy to learn and extensible template engine.

NVelocity is a port of the Apache Jakarta Velocity project. It is a simple, easy to learn and extensible template engine.

99 questions
0
votes
1 answer

In an NVelocity template how do you test for the existence of a property

I'm building a simple NVelocity template but I can't figure out how to test for the existence of a variable -- In this example I want to test if the context contains a property callwed User. I know I can implement the same functionality as a hacked…
0
votes
2 answers

Why does adding two values in nVelocity always returns zero?

I'm trying to add two values in velocity and it always returns 0. What am I doing wrong? #set ($tmpPrice = $orderItem.ExtendedPrice + $discountAmount) Both $orderItem.ExtendedPrice & $discountAmount are whole numbers with decimals, like this:…
mike
  • 2,722
  • 6
  • 31
  • 46
0
votes
1 answer

How to escape trailing backslash in NVelocity

I am using NVelocity to process various PowerShell scripts before they are executed against a server. My question is how to escape a backslash trailing a variable: e.g. ls \\$computername\c$ $computername should be replaced with a valid computer…
Ben Foster
  • 34,340
  • 40
  • 176
  • 285
0
votes
2 answers

How to create nested ViewComponents in Monorail and NVelocity?

I have been asked to update the menu on a website we maintain. The website uses Castle Windors Monorail and NVelocity as the template. The menu is currently rendered using custom made subclasses of ViewComponent, which render li elements. At the…
Rob Gray
  • 3,186
  • 4
  • 33
  • 34
0
votes
1 answer

Target Non-US Customers In Email Template (NVelocity)

I am using Able Commerce and need to customize the Customer Order Notification email template. I believe Able uses NVelocity for its email templates customization. I would like to display a message to Non-US customers only. In other words, I would…
Joe
  • 633
  • 4
  • 11
  • 18
0
votes
2 answers

Unable to find DateTool

in Java velocity, in order to format dates I just add the date tool to the context e.g. context.add("date", new DateTool()); and then inside the template $date.format('EEE, MMM d, yyyy at ha', $myDate) but in NVelocity I am unable to find the…
Crudler
  • 2,194
  • 3
  • 30
  • 57
0
votes
2 answers

Choose base class property when a new property exists in derived class

I have a Table class that inherits a property from its base class DbTableBase, and hides the base class property MegaList Columns with a more specific property MegaList Columns. Originally my app targeted Oracle only, but…
codenheim
  • 20,467
  • 1
  • 59
  • 80
0
votes
1 answer

Castle NVelocity Including Variables not Variable contents

I'm using Castles' NVelocity Engine to do some template work. Here's the problem. Several of my templates work fine, but one of them isn't. #foreach($i in $Items)
Timothy Baldridge
  • 10,455
  • 1
  • 44
  • 80
0
votes
1 answer

Implement sort in Nvelocity

I have a class which has approx 50 properties, instances of this class is added to a list. This list is then added to a Velocity context. Now, I would like to sort this data. Which field, or if it is ascending or descending is not known until the…
jmelhus
  • 1,130
  • 2
  • 12
  • 28
0
votes
1 answer

Avoid Nvelocity throwing exception when dictionary key does not exist

Adding a dictionary with values like this: Dictionary CustomArray = new Dictionary(); CustomArray.Add("customValue1", "mydata"); this.velocityContext.Put("array", CustomArray); Using the template engine like…
jmelhus
  • 1,130
  • 2
  • 12
  • 28
0
votes
0 answers

Is there a way to use nVelocity view engine with MVC 4

We currently have a site that was started over 6 years ago using Castle MonoRail V2 and the nVelocity View Engine. The problem is that we would like to update our technology but are stuck due to this limitation. I was thinking that since we can…
0
votes
1 answer

setting negative literals in NVelocity

I'm trying to set a negative literal in my NVelocity template and it doesn't parse. Is there a trick to making this work? Positive numbers work: #set($age = 27) Negative numbers do not work: #set($age = -27) #set($age = 27*-1) Lexical…
David
  • 83
  • 1
  • 1
  • 4
0
votes
1 answer

How to proper initialize the nvelocity engine?

As I saw in some examples, and tried to understand throughout the velocity site, there are three ways of initializing the velocityengine: - With the default configurations : .Init() - With the default configurations, plus the properties in a file :…
marcelo-ferraz
  • 3,147
  • 4
  • 38
  • 55
0
votes
1 answer

Nvelocity String To Double Conversation

Hi All I'm Using Nvelocity Library and i have some problem so i Have number 57,45 and i cant convert it to double $Convert.ToDouble($Value) returns 0. Thanks.
Gino4nx
  • 64
  • 1
  • 3
0
votes
0 answers

NVelocity messes up my html, or my browser fails to load all scripts?

So, i have the following layout (Monorail 2.1, NVelocity View Engine):
Cosmo D
  • 845
  • 4
  • 11
  • 21