tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Inconsistent output of Java 5 enums
Date Fri, 15 Oct 2010 14:11:29 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Oliver,

On 10/15/2010 1:40 AM, Oliver Siegmar wrote:
> Am Thursday 14 October 2010 schrieb Christopher Schultz:
>> So I'm surprised that Oliver is getting that weird output.
> 
> I wrote in my initial mail to this list "I have an enum that has an overridden 
> toString() method". I thought it was clear what that means, obviously it was 
> not. Sorry for the confusion. So this is a simplified example for my enum:

You're right: that was stupid of me. I had forgotten your toString method.

Uh... why override the toString method like that?

> 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}"/>

...will certainly work across these versions.

> One possible explaination is that Pid is right when he says "The related 
> sources jar was built in 2006, and the pom for that indicates that it's 
> dependent on JSP 2.0, rather than 2.1". Does anyone know if a true JSTL 1.2 
> using JSP 2.1 is available in the maven repository? Anyway I will try a 
> manually downloaded version tonight.

Try getting it from the canonical https://jstl.dev.java.net/, and ask
them about their Maven repo submission.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAky4YREACgkQ9CaO5/Lv0PDH8wCglvc2kcXjbc1ktxQdvOW5UOxl
OTkAoLzly4kRGfrWiPTvLvLHV7hEuH3+
=ClL+
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message