Bug 46462 - JSPWiki JSP compilation prevented by org.apache.jasper.Constants.JSP_PACKAGE_NAME
JSPWiki JSP compilation prevented by org.apache.jasper.Constants.JSP_PACKAGE_...
Status: RESOLVED FIXED
Product: Tomcat 6
Classification: Unclassified
Component: Jasper
6.0.18
Macintosh Mac OS X 10.4
: P2 major (vote)
: default
Assigned To: Tomcat Developers Mailing List
https://issues.apache.org/jira/browse...
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2009-01-01 20:29 UTC by Andrew Jaquith
Modified: 2009-01-14 16:22 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Jaquith 2009-01-01 20:29:15 UTC
Hi,

JSPWiki is currently an Incubator project at Apache. We intend to use the package name org.apache.jspwiki. However, any classes in this package tree fail to load when imported into a JSP page, specifically during Jasper's attempt to compile it.

For example, 

<%@ page import="org.apache.jspwiki.WikiPage" %>
 
does not compile. My colleague Harry Metske traced the cause to this line in org.apache.jasper.servlet.JasperLoader:



        if( !name.startsWith(Constants.JSP_PACKAGE_NAME) ) {
            // Class is not in org.apache.jsp, therefore, have our
            // parent load it
            clazz = parent.loadClass(name);            
            if( resolve )
                resolveClass(clazz);
            return clazz;
        }

The recommended bug fix would be to append a period (".") to the expression passed into name.startsWith(), which in this case would then evaluate to "org.apache.jsp.", and allow JSPWiki classes to load and compile.

This issue is important for us as we emerge from incubation. Lack of a fix means that JSPWiki cannot release under the desired package name "org.apache.jspwiki."

See additional commentary in the Apache JIRA database here: 
https://issues.apache.org/jira/browse/JSPWIKI-464
Comment 1 Mark Thomas 2009-01-02 03:10:31 UTC
This has been fixed in trunk and proposed for 6.0.x. providing it gets two more +1 votes it will be included in 6.0.19 onwards.
Comment 2 metskem 2009-01-02 03:52:38 UTC
I created a new separate JIRA issue for JSPWiki:

https://issues.apache.org/jira/browse/JSPWIKI-465
Comment 3 Mark Thomas 2009-01-14 16:22:56 UTC
This has been fixed in 6.0.x and will be included in 6.0.19 onwards.