tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 39530] New: - Tomcat 5.5.17 generates incorrect code with trimSpaces turned on.
Date Tue, 09 May 2006 13:24:49 GMT
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=39530>.
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=39530

           Summary: Tomcat 5.5.17 generates incorrect code with trimSpaces
                    turned on.
           Product: Tomcat 5
           Version: 5.5.17
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: ajbanck@informatica.com


Tomcat 5.5.17 generates incorrect results with trimSpaces turned on.

TEST.JSP
==========
<%
            String onClickCmd  = "onclick=\"" + "dummyOnclick" + "\"";
            String onKeydownCmd= "onkeydown=\"if (event.keyCode==13) {" +
"dummyOnkeydown()" + "}\"";
            String tabIndexAttr= "tabindex=\"0\"";
            String tClass      = "InfWizardStep_Active";

%>
        <td class="<%=tClass%>"
            <%=tabIndexAttr%>
            <%=onClickCmd%>
            onmouseover="dummyOnmouseover()"
        />



When precompiling with org.apache.jasper.JspC and trimSpaces="true" the
following Java is generated:


Generated Java with trimSpaces
=======================
            String onClickCmd  = "onclick=\"" + "dummyOnclick" + "\"";
            String onKeydownCmd= "onkeydown=\"if (event.keyCode==13) {" +
"dummyOnkeydown()" + "}\"";
            String tabIndexAttr= "tabindex=\"0\"";
            String tClass      = "InfWizardStep_Active";


      out.write("<td class=\"");
      out.print(tClass);
      out.write("\"\r\n");
      out.write("            ");
      out.print(tabIndexAttr);
      out.print(onClickCmd);
      out.write("\r\n");
      out.write("            onmouseover=\"dummyOnmouseover()\"\r\n");
      out.write("        />\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jsp

 
This generates the following incorrect fragment:

Generated HTML with trimSpaces. Note that there is no space between "0" and onclick
========================
<td class="InfWizardStep_Active"
            tabindex="0"onclick="dummyOnclick"
            onmouseover="dummyOnmouseover()"
        />




This code works when trimSpaces is not enabled, following are the results
without trimSpaces.

When precompiling with org.apache.jasper.JspC and trimSpaces="false" the
following Java is generated
Generated Java without trimSpaces
==========================
            String onClickCmd  = "onclick=\"" + "dummyOnclick" + "\"";
            String onKeydownCmd= "onkeydown=\"if (event.keyCode==13) {" +
"dummyOnkeydown()" + "}\"";
            String tabIndexAttr= "tabindex=\"0\"";
            String tClass      = "InfWizardStep_Active";


      out.write("\r\n");
      out.write("        <td class=\"");
      out.print(tClass);
      out.write("\"\r\n");
      out.write("            ");
      out.print(tabIndexAttr);
      out.write("\r\n");
      out.write("            ");
      out.print(onClickCmd);
      out.write("\r\n");
      out.write("            onmouseover=\"dummyOnmouseover()\"\r\n");
      out.write("        />\r\n");


Generated HTML without trimSpaces
===========================
        <td class="InfWizardStep_Active"
            tabindex="0"
            onclick="dummyOnclick"
            onmouseover="dummyOnmouseover()"
        />

-- 
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


Mime
View raw message