Bug 6293 - TLVs does not accept valid useBean action elements
Summary: TLVs does not accept valid useBean action elements
Status: CLOSED FIXED
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: unspecified
Hardware: All All
: P3 blocker (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-02-07 05:14 UTC by Hans Bergsten
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hans Bergsten 2002-02-07 05:14:42 UTC
The TLVs startElement() method goes through all its tests no matter which tag 
library an element belongs to. This results in the hasDanglingScope() method
returning true for a perfectly valid <jsp:useBean> action. This is the case for
the TLVs for all JSTL libraries.

The solution is to add this right after the getLocalPart() call:

  // Just return if its an element with a foreign prefix
  if (!qn.startsWith(prefix + ":")) {
      return;
  }

With this addition, the JSP_TEXT test can likely be removed.
Comment 1 Shawn Bayern 2002-02-07 14:01:39 UTC
Thanks for the report, Hans.  I have fixed the error, although I implemented
a different check than the one you suggest.  The validator wouldn't work 
properly if I added the check you suggest:  startElement() may legitimately be
concerned with elements that are not of the taglib's prefix.  For instance,
it may desire to block ALL content within certain tags.  (Consider

  <c:choose>
     <form>
        ...

)

You may have misunderstood the check for <jsp:text>:  the goal isn't to rule
out and ignore all text in the page, but as the comment says, to 
avoid "distinguishing between it and its characters."  That is, I wouldn't
want a text element that contained nothing but whitespace, as --

  <jsp:text>  </jsp:text>

-- to invalidate a <c:choose> tag.  The easiest way to do this is to ignore
<jsp:text> and </jsp:text>, and instead logically merge them with the characters
they contain (or oblivion if they contain no characters), given our constraints.

Thanks again.