velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Heuer <heue...@acm.org>
Subject Re: Java 5 enum
Date Thu, 29 Dec 2005 21:58:40 GMT

Glenn Holmer wrote:

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

That is what I had to do.

For what it is worth, I received no reply to a similar message I sent to
velocity-user some time ago:

> http://marc.theaimsgroup.com/?l=velocity-user&m=108455529517154&w=2

   michael


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