velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Glass-Husain" <wgl...@forio.com>
Subject Re: Java 5 enum
Date Fri, 30 Dec 2005 00:11:23 GMT
Have you tried this with the latest from source code head?  (unreleased 
version 1.5).  Equality for items of different classes is now based on the 
toString automatically.
http://issues.apache.org/jira/browse/VELOCITY-350

I haven't tried this with Java 5 enums, but I'd think this would work.

WILL

----- Original Message ----- 
From: "Glenn Holmer" <gholmer@weycogroup.com>
To: "Velocity Users List" <velocity-user@jakarta.apache.org>
Sent: Thursday, December 29, 2005 10:30 AM
Subject: Java 5 enum


> 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
> 


---------------------------------------------------------------------
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