You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jeremy Boynes <jb...@apache.org> on 2014/12/01 08:35:14 UTC

How can I determine if a namespace maps to a tag library in a TLV?

I ran into an issue with PermittedTaglibsTLV not rejecting tags in JSP Documents (aka .jspx files). See:
  https://issues.apache.org/bugzilla/show_bug.cgi?id=57290

In trying to fix that I’ve run into a problem determining if a namespace declaration in the XML view of the page corresponds to a tag library or not. For regular JSP files (.jsp files) all taglib directives become namespace declarations on the <jsp:root> element and no other namespaces get defined. However, for JSP Documents (.jspx files) the namespace declarations can occur on any element in the XML view. I can see what namespaces are used but haven’t figured out how to tell if one maps to a tag library or is simply output.

In TagExtraInfo a validate method can call getTagInfo().getTagLibrary().getTagLibraryInfos() to get the list of libraries and hence their ids. Is there anything similar a TagLibraryValidator can do?

Thanks
Jeremy