Bug 11204 - JSTL fmt tags: tag body reevaluation
Summary: JSTL fmt tags: tag body reevaluation
Status: RESOLVED FIXED
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: 1.0
Hardware: Other other
: P3 major (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
: 13394 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-07-26 13:05 UTC by Juergen Hoeller
Modified: 2004-11-16 19:05 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Hoeller 2002-07-26 13:05:54 UTC
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
Comment 1 Jan Luehe 2002-07-27 00:17:09 UTC
I'm unable to reproduce this problem using Jasper2.
Note that even with tag reuse enabled, a tag's body always gets (re)evaluated.
Comment 2 Juergen Hoeller 2002-07-27 19:45:07 UTC
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
Comment 3 Jan Luehe 2002-07-29 18:51:50 UTC
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.

Comment 4 Jan Luehe 2002-10-08 23:06:17 UTC
*** Bug 13394 has been marked as a duplicate of this bug. ***
Comment 5 Pierre Delisle 2002-12-03 21:14:19 UTC
*** Bug 14695 has been marked as a duplicate of this bug. ***