Summary: | TLD Validation error for HTML "param" element | ||
---|---|---|---|
Product: | Taglibs | Reporter: | Michał Borowiecki <mihbor> |
Component: | Standard Taglib | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | P2 | ||
Version: | nightly | ||
Target Milestone: | --- | ||
Hardware: | Other | ||
OS: | other |
Description
Michał Borowiecki
2005-10-11 21:23:13 UTC
Try adding the XHTML namespace to the <html> element: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:jstlc="http://java.sun.com/jsp/jstl/core" xmlns:jstlf="http://java.sun.com/jsp/jstl/fmt"> ... The html <param> is being treated incorrectly as an <fmt:param> tag, because of this code in JstlBaseTLV: protected boolean isTag(String tagUri, String tagLn, String matchUri, String matchLn) { if (tagUri == null || tagLn == null || matchUri == null || matchLn == null) return false; if (tagUri.length() > matchUri.length()) { return (tagUri.startsWith(matchUri) && tagLn.equals(matchLn)); } else { return (matchUri.startsWith(tagUri) && tagLn.equals(matchLn)); } In the test case, isTag() is invoked with these args: tagUri="" tagLn="param" matchUri="http://java.sun.com/jsp/jstl/fmt" matchLn="param" which means the "else" will return TRUE, since any string starts with the empty string! The fix is to return FALSE if the "tagUri" param is NULL or the EMPTY string, as shown in these diffs: --- JstlBaseTLV.java 8 Dec 2005 01:21:24 -0000 +++ JstlBaseTLV.java 10 Dec 2005 00:01:32 -0000 @@ -210,6 +210,7 @@ String matchUri, String matchLn) { if (tagUri == null + || tagUri.length() == 0 || tagLn == null || matchUri == null || matchLn == null) Applied Jan's patch. Thanks Jan! |