velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tyler Kremberg" <tkremb...@2co.com>
Subject Noob Question about Object Access
Date Tue, 23 Oct 2007 21:59:20 GMT
Please ignore my ignorance, I've read through the documentation and haven't
figured out how to solve my problem.  ; I am a front-end developer coming
from the PHP world with only some JSP background.  I am working on a system
that I do not have the source to.  Anyway, I have access to price
information.

#set ($productPrice = $product.getPrice($sesShoppingCart.getCurrency()))
#set ($listPrice = $price.getAmount())
				
I even have access to a Class with comparator methods.
I need to do something like this: 
 
#if( $price.lessThan($upperBound) && $price.greaterThan($lowerBound) )
   Hooray!
#end

In JSP, I could write a scriptlet.
BigDecimal upperAmount = new BigDecimal("1500.00");
$upperBound = new MoneyImpl(upperAmount, "USD");

My question, how can I create the $upperBound and $lowerBound as Money
objects in the scope of this template.  What is the best way to do this in
Velocity?  Am I barking up the wrong tree?

Help is greatly appreciated.  Thanks!


Tyler
	
P.S. For reference, class documentation:
http://edocs.bea.com/alcs/docs51/javadoc/com/elasticpath/domain/misc/Money.h
tml#greaterThan(com.elasticpath.domain.misc.Money)

http://edocs.bea.com/alcs/docs51/javadoc/com/elasticpath/domain/misc/impl/Mo
neyImpl.html



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


Mime
View raw message