Summary: | Wrong behaviour of x:out inside x:forEach | ||
---|---|---|---|
Product: | Taglibs | Reporter: | Flavio <flaviotordini> |
Component: | Standard Taglib | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | brodseba |
Priority: | P3 | ||
Version: | 1.1.0 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Attachments: |
Manual Test JSP
XML for Test JSP Patch to fix this issue Cactus test for this issue |
Description
Flavio
2004-07-13 10:11:38 UTC
Confirmed. If you do the same code outside the x:forEach, it the first x:out succeeds and the second x:out fails, as expected. Switching away from the reader and to a string doesn't get rid of the bug. Debugging... all I've found out so far is that when the x:out is in the forEach, the $sample2 at the front makes its way down into the guts. If I add a hack to remove '$sample2' from things though, they're not magically fixed. The other difference is that the ContextNode is CNode: [link: null] in the forEach case and CNode: [#document: null] in the simple case. That seems very likely to be tied to the bug - without really knowing what they are, it seems that a different xml document should have a different context node. Digging more. The ContextNode is a modified version of the Node parameter passed in - it represents '.'. It's document specific - so should be tied to the xml document in question and not be shared. However...this doesn't explain why the alternative actually does work. Created attachment 19258 [details]
Manual Test JSP
Created attachment 19259 [details]
XML for Test JSP
Created attachment 19260 [details]
Patch to fix this issue
This looks like it fixes the problem. If the expression starts with a $...,
then re-evaluate rather than returning the current node.
Created attachment 19295 [details]
Cactus test for this issue
svn ci -m "Applying cactus test and patch for issue #30068" Sending src/org/apache/taglibs/standard/tag/common/xml/XPathUtil.java Adding test/org/apache/taglibs/standard/tag/el/xml Adding test/org/apache/taglibs/standard/tag/el/xml/Test30068.java Adding test/web/org/apache/taglibs/standard/tag/el/xml Adding test/web/org/apache/taglibs/standard/tag/el/xml/Test30068.jsp Adding test/web/org/apache/taglibs/standard/tag/el/xml/Test30068.xml Transmitting file data .... Committed revision 489238. |