Hello,
now I tried with jstl-api-1.2.jar and jstl-impl-1.2.jar downloaded from
https://jstl.dev.java.net/download.html - same result.
Am Friday 15 October 2010 schrieb Christopher Schultz:
> >> Uh... why override the toString method like that?
> >
> > Well, as written in java.lang.Enum:
> >
> > An enum type should override this method when a more
> > "programmer-friendly" string form exists.
>
> Fair enough. I feel like VALID versus INVALID (which could be confusing
> in this case) would be plenty programmer-friendly.
Taht was just a simplified class for demonstration purposes.
> >>> The thing is, that EL is using the name() method to print the enum and
> >>> JSTL is using toString(). I did not expect a different enum treatment
> >>> here.
> >>
> >> If you need it to emit the same thing, doing:
> >>
> >> <c:out value="${myEnumValue.name}"/>
> >
> > No, because that would call a method getName() which doesn't exist - the
> > method is named name().
>
> <c:out value="${myEnumValue.getName()}"/>
You can't do that (at least not with Tomcat 6.0.29).
> Or, just consistently use EL, since that actually works as you expect.
Well...it is again just a simplified example.
Bye
Oliver
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]