velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew Van Horn" <>
Subject Class cast issue?
Date Tue, 03 Aug 2004 10:09:48 GMT
I have a typesafe enum class with methods:

    public final Serializable getEnumCode() {
        return enumCode;

    public String toString() {
        return name;

I put a number of these objects into a SortedSet, and in my template I

#foreach($obj in $objSet)
<option value="$obj.enumCode">$obj</option>

This outputs:

<option value="$obj.enumCode">Foo</option>
<option value="$obj.enumCode">Bar</option>
<option value="$obj.enumCode">Baz</option>

I have tried :
<option value="$obj.getEnumCode()">
<option value="$obj.getEnumCode().toString()">

But none of them seem to return a value.

Does it have anything to do with the fact that the method returns
Serializable? How can I get it to do the obvious?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message