There may be a velocity tool to do this, but it may also be better implementing the logic in the java file instead...
ie just include a different String template_name depending on the enum value in the back end and #parse("$template_name"); On Thursday 29 December 2005 21:58, Michael Heuer wrote: > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]