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 2003/10/22 17:23:40 UTC

DO NOT REPLY [Bug 24009] New: - Jasper option for "whitespace-optimized" HTML output

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

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24009

Jasper option for "whitespace-optimized" HTML output

           Summary: Jasper option for "whitespace-optimized" HTML output
           Product: Tomcat 4
           Version: 4.1.27
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Jasper 2
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: bernd.steinert@gmx.net


Jasper generates servlet code, which doesn´t trim any whitespaces from the
original JSP sourcefile. This causes the HTML output to have lots of empty lines
and tabs and blanks. In Tomcat 4.1.27 I simply changed 
org.apache.jasper.compiler.Parser.parseTemplateText(Node parent)
to trim whitespaces (see Attachment).

good effects
------------
In a sample application this reduced the generated HTML code by approx. 30%
without any negative side-effects. 
The jasper-generated Java source has no more 'out.write("\n\r");' so we save
some complete method calls.

bad effects
-----------
Generated HTML is unreadable (which may be OK for productive installations)
(any others???)


I think of this enhancement as an optimization parameter, most useful for
productive installations. So this should be made configurable via CLI and in
$CATALINA_BASE/conf/web.xml.

What do you think about this???

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