Bug 42943 - jsp:text gets confused with other *:text elements in a JSP tag file
jsp:text gets confused with other *:text elements in a JSP tag file
Status: RESOLVED FIXED
Product: Tomcat 5
Classification: Unclassified
Component: Jasper
5.0.30
Other other
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2007-07-20 03:46 UTC by Vojtech Toman
Modified: 2008-07-30 13:46 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vojtech Toman 2007-07-20 03:46:22 UTC
I have a JSP .tag file (label.tagx) that I want to use in other JSPs. The tag
file looks as follows:

<jsp:root version="2.0"
   xmlns:jsp="http://java.sun.com/JSP/Page">
  <jsp:directive.tag body-content="scriptless"/>
  <dul:text xmlns:dul="http://www.whatever.com/dul"><jsp:doBody/></dul:text>
</jsp:root>


When I want to use this tag file in a JSP:

...
<tagx:label>blablabla</tagx:label>
...

I get the stacktrace at the end of this message.

However, if I replace the dul:text element with something else, such as
dul:dul:textzz, then everything works fine:

<jsp:root version="2.0"
   xmlns:jsp="http://java.sun.com/JSP/Page">
  <jsp:directive.tag body-content="scriptless"/>
  <dul:textzz xmlns:dul="http://www.whatever.com/dul"><jsp:doBody/></dul:textzz>
</jsp:root>

Seems like the dul:text and jsp:text tags get confused (namespace problems?)
somewhere during the page compilation.

Stacktrace:

2007-07-20 12:05:50,828 [http-8080-Processor25] ERROR
org.apache.struts.taglib.tiles.InsertTag - ServletException in
'/WEB-INF/jsp/test-page.jsp': /WEB-INF/tags/label.tagx(6,90) &lt;jsp:text&gt;
must not have any subelements
org.apache.jasper.JasperException: /WEB-INF/tags/label.tagx(6,90)
&lt;jsp:text&gt; must not have any subelements
	at
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
	at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
	at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:90)
	at org.apache.jasper.compiler.JspDocumentParser.parse(JspDocumentParser.java:201)
	at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:197)
	at org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
	at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:495)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
	at
org.apache.jasper.servlet.JspServletWrapper.loadTagFile(JspServletWrapper.java:201)
	at
org.apache.jasper.compiler.TagFileProcessor.loadTagFile(TagFileProcessor.java:514)
	at org.apache.jasper.compiler.TagFileProcessor.access$000(TagFileProcessor.java:47)
	at
org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:565)
	at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
	at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2324)
	at org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
	at
org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:569)
	at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
	at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2224)
	at org.apache.jasper.compiler.Node$JspRoot.accept(Node.java:525)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
	at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
	at org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
	at
org.apache.jasper.compiler.TagFileProcessor.loadTagFiles(TagFileProcessor.java:583)
	at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:226)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:495)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
	at
org.apache.jasper.servlet.JspServletWrapper.loadTagFile(JspServletWrapper.java:201)
	at
org.apache.jasper.compiler.TagFileProcessor.loadTagFile(TagFileProcessor.java:514)
	at org.apache.jasper.compiler.TagFileProcessor.access$000(TagFileProcessor.java:47)
	at
org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:565)
	at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
	at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2324)
	at org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
	at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2324)
	at org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
	at
org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:569)
	at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
	at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2324)
	at org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
	at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2324)
	at org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
	at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2324)
	at org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
	at
org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:569)
	at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
	at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2224)
	at org.apache.jasper.compiler.Node$JspRoot.accept(Node.java:525)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
	at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
	at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
	at org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
	at
org.apache.jasper.compiler.TagFileProcessor.loadTagFiles(TagFileProcessor.java:583)
	at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:226)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:495)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:696)
	at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:585)
	at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:510)
	at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
	at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:602)
	at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:101)
	at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:137)
	at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:758)
	at
org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:890)
	at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:460)
	at
org.apache.jsp.WEB_002dINF.jsp.layouts.default_jsp._jspx_meth_tiles_insert_4(default_jsp.java:401)
	at
org.apache.jsp.WEB_002dINF.jsp.layouts.default_jsp._jspService(default_jsp.java:135)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:696)
	at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
	at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
	at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
...
Comment 1 Henri Yandell 2007-08-06 20:02:57 UTC
Out of interest, what do you find if you move the 'dul' namespace declaration up
to the <jsp:root>? Any change?
Comment 2 Vojtech Toman 2007-08-28 04:16:50 UTC
(In reply to comment #1)
> Out of interest, what do you find if you move the 'dul' namespace declaration up
> to the <jsp:root>? Any change?

That doesn't seem to change anything, I get the same error.
Comment 3 Mark Thomas 2008-05-08 14:56:23 UTC
This has been fixed in trunk and proposed for 5.5.x and 6.0.x
Comment 4 Mark Thomas 2008-05-15 13:59:04 UTC
The patch has been applied to 6.0.x and will be included in 6.0.17 onwards.
Comment 5 Mark Thomas 2008-07-30 13:46:36 UTC
This has been fixed in 5.5.x and will be included in 5.5.27 onwards.