The following snippet of a JSP using JSTL <fmt:formatNumber>123456789</fmt:formatNumber> <fmt:formatNumber>23456789</fmt:formatNumber> results in "123.456.789" twice in some Servlet containers. Obviously, the tag body is sometimes not reevaluated in recurring formatNumber tags. This works in Tomcat 4.0.4 (Jasper 1 with no tag reuse) but not in 4.1.7 (Jasper 2 with tag reuse), so it seems that the tag is not reusable concerning the body. It does not work in Resin 2.1.2 (also with tag reuse) either. Because JSP expressions can only be placed in the tag body and not in "value" parameters, this bug is a show stopper for using the JSTL fmt tags in our application. Regards, Juergen
I'm unable to reproduce this problem using Jasper2. Note that even with tag reuse enabled, a tag's body always gets (re)evaluated.
This issue IS existent: I can reproduce it in every try, with Tomcat 4.1.7 and Caucho's Resin 2.1.3. I have even tried the latest nightly build of the Jakarta JSTL: same behavior. I have also contacted the Tomcat team. Remy Maucherat's answer was: <quote> It looks like this tag is not compatible with tag reuse. It is the tag which is non compliant with the specification, not a Jasper 2 bug. </quote> And I have contacted Scott Ferguson from Caucho Technologies, the makers of the Resin Servlet container. Note that the issue occurs with Resin only if I use Jakarta's JSTL instead of Cauchos's optimized one. Scott's answer was: <quote> The Jakarta implementation is buggy. It stores the BodyContent from one tag in the same field variable it uses for 'value'. So the second time the tag is used, the tag thinks the 'value' has been specified with the old body content. </quote> Please have an in-depth look at this issue, as it really makes it difficult for me to advocate the JSTL in my team. Feel free to contact me, Remy, or Scott for further details and analysis. Regards, Juergen
Juergen, OK, I was able to reproduce your problem this time. I don't undertstand why I wasn't able to reproduce it the first time, or maybe I was but didn't realize it. ;-) My aplogies. Anyway, I have just committed a fix for <fmt:formatNumber> and all other fmt tags that were suffering from the same problem.
*** Bug 13394 has been marked as a duplicate of this bug. ***
*** Bug 14695 has been marked as a duplicate of this bug. ***