Bug 39557 - Include of JSP documents with custom tag libs
Summary: Include of JSP documents with custom tag libs
Status: RESOLVED WORKSFORME
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Jasper (show other bugs)
Version: Unknown
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
: 35252 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-05-11 11:42 UTC by solaris42
Modified: 2009-07-07 13:55 UTC (History)
1 user (show)



Attachments
Patch to update host-manager webapp to use servlet 2.4 xsd (866 bytes, patch)
2006-12-28 09:33 UTC, Chris Halstead
Details | Diff
Patch to update servlets-examples webapp to use servlet 2.4 xsd (1.98 KB, patch)
2006-12-28 09:34 UTC, Chris Halstead
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description solaris42 2006-05-11 11:42:56 UTC
Hi,

We have two JSP documents a.jsp and b.jsp. Suppose that some custom library is
defined correctly under the prefix "x". There is a tag library validator
associated with the TLD. The same bug is observed in Tomcat 5 while it is
working on Tomcat 4.
---- a.jsp -----
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:x="http://some/tld" >
  <jsp:directive.include file="b.jsp"/>
</jsp:root>

---- b.jsp ----
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page"  >
    <x:doAction/>
</jsp:root>

When I try to request a.jsp i receive this exception:
org.apache.jasper.JasperException: b.jsp(%row%,%column%) The prefix "x" for
element "x:doAction" is not bound.

But when I add the namespace to the jsp:root of the b.jsp the validator of the
taglibrary complains with:

Validation error messages from TagLibraryValidator for trx
null: org.xml.sax.SAXParseException: Attribute "x" bound to namespace
"http://www.w3.org/2000/xmlns/" was already specified for element "jsp:root".

This is against JSP 2.0, 2.1 specification: JSP.10.3.5 Collective Application of
Inclusion Semantics. This makes inclusion of JSP documents with custom tag
libraries that validate the XML view impossible.

Best regards,
Todor Mollov
Comment 1 Mark Thomas 2006-10-01 20:46:00 UTC
*** Bug 35252 has been marked as a duplicate of this bug. ***
Comment 2 Chris Halstead 2006-12-28 09:33:25 UTC
Created attachment 19315 [details]
Patch to update host-manager webapp to use servlet 2.4 xsd
Comment 3 Chris Halstead 2006-12-28 09:34:09 UTC
Created attachment 19316 [details]
Patch to update servlets-examples webapp to use servlet 2.4 xsd
Comment 4 Chris Halstead 2006-12-28 09:41:18 UTC
Very weird...I posted a comment to 40507 and then when I went to post patches I
somehow got punted to this bug without realizing it.  The patches are for 40507,
not this bug.  Sorry for the dupes.
Comment 5 Yoav Shapira 2007-03-25 14:23:27 UTC
40507 has been fixed, using the patches you sent in Chris -- thanks.
Comment 6 Mark Thomas 2009-07-07 13:55:29 UTC
This works for me with the latest 5.5.x code as well as trunk.