You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2007/10/26 12:17:18 UTC

DO NOT REPLY [Bug 43702] New: - Class Files Have Unnecessarily Long Names when Using SimpleTags

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43702>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43702

           Summary: Class Files Have Unnecessarily Long Names when Using
                    SimpleTags
           Product: Tomcat 5
           Version: 5.5.24
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: dgardner@curamsoftware.com


I have been using Tomcat 5.5.7 (though I have checked this on the
latest 5.5 and 6.0 releases too) and had some problems with very
long class file names when using the SimpleTag interface for a
custom tag in a JSP document (the XML representation).

>From my reading of the code in Jasper, and my observation of the files
on my disk, if I have a JSP file "WebContent/mypages/MyPage.jspx",
then a class file named "work/org/apache/jsp/mypages/MyPage_jspx.class"
will be generated by Jasper.

If I use the SimpleTag interface for one of my custom tags on that
JSP, a "helper" class (an inner class of the "MyPage_jspx" class) is
also generated. The naming convention appends "Helper" to the "outer"
class name to create the inner class name resulting in a class file
named "work/org/apache/jsp/mypages/MyPage_jspx$MyPage_jspxHelper.class".

As there is only one "helper" class required, it could just be named
"Helper", instead of "MyPage_jspxHelper". The "outer" class provides
a namespace that is duplicated unnecessarily in the name of the inner
class. Another alternative would be to generate this as an independent
class instead of an inner class (they could reside in the same source
file).

This may not seem to be a particularly important issue, but it becomes
a real problem if the name of the JSP is very long. We generate JSP
files from other sources that often use very long names (the names
are chosen by our customers, so we do not have a lot of control over
how long they can get). We have recently started to use the SimpleTag
interface to try to reduce the size of the Java classes generated by
Jasper (the generated code is more compact, as there is less code needed
to handle return values, etc.) However, we quickly found that if a
developer's project directory was deeply nested on the file system
(i.e., the path to the "work" directory) and/or the JSPs had long names
(some names were as long as 96 characters) that the filesystem path
length limit on Windows was exceeded and we got "class not found"
errors from Tomcat at run-time for classes that clearly existed on the
filesystem. I have seen these errors before in other circumstances and
they are caused when the path length limit is exceeded.

A trivial change to the Jasper code generator to avoid replicating the
name of the "outer" class in the name of the inner "helper" class would
go a long way to alleviating this problem. I cannot think of any reason
why this would not be a useful improvement to Jasper. It is a one line
change to the constructor of the "org.apache.jasper.compiler.Generator"
class where the FragmentHelperClass object is created (and probably in
some other area where references to this helper are generated into the
servlet code).

Other improvements to the compactness of the generated code could also
be made by more extensive use of "import" statements, but that would
probably not have any effect on the size of the ".class" file after
compilation (or would it?).

For our part, we have had to stop using the SimpleTag interface for
our custom tags, and have to start investigating a way of truncating
long JSP file names to avoid being caught out by Jasper's verbosity
and the Windows path length limit.

Should I report this issues separately against Tomcat 6?

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

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


DO NOT REPLY [Bug 43702] - Class Files Have Unnecessarily Long Names when Using SimpleTags

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43702>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43702





------- Additional Comments From markt@apache.org  2007-11-27 15:04 -------
Fixed in trunk and 6.0.x. Proposed for 5.5.x.

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

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


DO NOT REPLY [Bug 43702] - Class Files Have Unnecessarily Long Names when Using SimpleTags

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43702>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43702





------- Additional Comments From markt@apache.org  2007-10-30 19:18 -------
I have proposed a patch for tc6. If accepted, I'll propose a backport to 5.5.x

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

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


DO NOT REPLY [Bug 43702] - Class Files Have Unnecessarily Long Names when Using SimpleTags

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43702>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43702


markt@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From markt@apache.org  2007-11-29 14:56 -------
Fixed in svn for 5.5.x. Will be in 5.5.26 onwards.

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

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