https://issues.apache.org/bugzilla/show_bug.cgi?id=49714

           Summary: The annotation process of Jar should not impact
                    distributable of web.xml.
           Product: Tomcat 7
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: kfuj...@apache.org


Even if < distributable/> is set to web.xml(servlet3.0), 
distributable is changed from true to false by the annotation process of JAR. 

ContextConfig#processAnnotations is as follows. 
===ContextConfig#processAnnotations
protected void processAnnotations(Set<WebXml> fragments) {
    for(WebXml fragment : fragments) {
        if (!fragment.isMetadataComplete()) {
            WebXml annotations = new WebXml();
            URL url = fragment.getURL();
            processAnnotationsUrl(url, annotations);
            Set<WebXml> set = new HashSet<WebXml>();
            set.add(annotations);
            // Merge annotations into fragment - fragment takes priority
            fragment.merge(set);
        }
    }
}
===
distributable of "annotations" created by new WebXml() is false (default). 
If "annotations" is merged with "fragment", distributable of "fragment" becomes
false. 

Because "fragment" is merged with web.xml of the web application,
even if < distributable/> is set to web.xml, distributable is changed from true
to false. 

The following are necessary. 
annotations.setDistributable(true);

Best regards.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to