tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Siegmar <oli...@siegmar.org>
Subject Re: Inconsistent output of Java 5 enums
Date Sat, 16 Oct 2010 05:57:27 GMT
Am Saturday 16 October 2010 schrieb Maximilian Stocker:
> Okay. Then while I think it is a bug in tomcat (but it might be tomcat 5
> that has the bug because I still don't 100% understand what it *should*
> do) I am not sure what the problem is.
> 
> Do you want the toString value or the name() value? If it's the name value
> then there is no danger in using it outside of c:out anyway because I am
> pretty sure you can't use characters that would need to be escaped as enum
> labels to begin with. And if it's the toString then c:out is using it...

I think, that name() should be used all the time, because of section 1.18.2 of 
the 2.1 JSP-EL spec.

My real usage scenario is, that I'm using Spring's message tag to output a 
message from a ResourceBundle.

<spring:message code="enums.${myEnumValue}"/>

But Tomcat calls the setCode() method with 
"enums.myEnumToStringRepresentation" instead of 
"enums.myEnumNameRepresentation". Because the toString() representation 
includes whitespaces and other special characters that doesn't work well. Of 
course I can find workarounds, but I wanted to discuss if this is a bug or 
not.


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


Mime
View raw message