velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan <i...@buc.com>
Subject ArrayList Failure
Date Tue, 13 Feb 2001 16:55:44 GMT
Christoph's note of Jan 24 says that I can use an array defined in the
template, but I haven't been successful.

Velocity.jar version: nightly build 20010213

Template snipet:
#set ($condText = ["Mint", "Better Condition", "Average Condition",
"Fair", "Poor", "Restorable"])
---
I've tried
#if ($b.adjusted)Fair Market Price Adjusted for
$condText.get($query.cond): $b.adjusted<br>#end

and this
     #set ($i = $query.cond)
      #if ($b.adjusted)Fair Market Price Adjusted for $condText.get($i):
$b.adjusted<br>#end

and this
   #set ($i = $query.cond)
      #if ($b.adjusted)Fair Market Price Adjusted for $condText.get(i):
$b.adjusted<br>#end

None of the above work ...Log file says that $condText.get(i) or
$condText.get($i) or $condText.get($query.cond) is not a valid
reference.

The following works:
    #if ($b.adjusted)Fair Market Price Adjusted for $condText.get(2):
$b.adjusted<br>#end

Am I missing something here?
Ivan Saltz

(P.S. This will be a production system.)


Mime
View raw message