Bug 46047

Summary: Issue when using include directive inside tag files that are inside jar files
Product: Tomcat 6 Reporter: Cédric Mailleux <cedric.mailleux>
Component: JasperAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: critical    
Priority: P2    
Version: 6.0.18   
Target Milestone: default   
Hardware: PC   
OS: Linux   
Attachments: patch for ParserController class

Description Cédric Mailleux 2008-10-21 02:20:44 UTC
Created attachment 22760 [details]
patch for ParserController class

When we use the include directive inside a tag file like :
<%@ tag body-content="empty" description="Renders a date control to query the creation date of a content object." %>

<%@include file="/META-INF/tags/search/declaration.tagf" %>

And that this tag file is inside a jar file, jasper has an issue dealing the dependencies by losing the fact that the included file is inside a jar file.

static {
    _jspx_dependants = new java.util.ArrayList(4);
    _jspx_dependants.add("/META-INF/tags/search/declaration.tagf");
    _jspx_dependants.add("/META-INF/tags/search/date.tagf");
    _jspx_dependants.add("jar:file:/home/rincevent/tools/apache-tomcat-6.0.18/webapps/jahia/WEB-INF/lib/jahia-taglib-6.0-SNAPSHOT.jar!/META-INF/search.tld");
    _jspx_dependants.add("jar:file:/home/rincevent/tools/apache-tomcat-6.0.18/webapps/jahia/WEB-INF/lib/jahia-taglib-6.0-SNAPSHOT.jar!/META-INF/tags/search/resultsPageUrl.tag");
  }

The other dependencies are handled correctly thanks to patch https://issues.apache.org/bugzilla/show_bug.cgi?id=43741 .

I propose a patch to ParserController so that when we detect that we are inside a jarFile we prepend the jarFileUrl to absFileName.

The patch has been made on the trunk source code of tomcat.
Comment 1 Mark Thomas 2008-11-03 14:53:23 UTC
This has been applied to trunk and proposed for 6.0.x. Many thanks for the patch.
Comment 2 Mark Thomas 2008-11-30 15:07:07 UTC
This has been fixed for 6.0.x and will be included in 6.0.19 onwards.