velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glenn Holmer <ghol...@weycogroup.com>
Subject Java 5 enum
Date Thu, 29 Dec 2005 18:30:09 GMT
We're considering holding a session variable as a Java 5 "enum", in 
which case it looks like we'd have to test its toString() value to 
branch on it in a Velocity template, e.g.

#if ($userType.toString() == "salesman")
  ## do salesman stuff
#elseif ($userType.toString() == "customer")
  ## do customer stuff
#end

Is that the right way to do this in Velocity?

-- 
____________________________________________________________
Glenn Holmer                          gholmer@weycogroup.com
Software Engineer                        phone: 414-908-1809
Weyco Group, Inc.                          fax: 414-908-1601

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


Mime
View raw message