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 14080] New: - Compile error when the JSP has a %% character
Date Wed, 30 Oct 2002 03:21:04 GMT
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=14080>.
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=14080

Compile error when the JSP has a %% character

           Summary: Compile error when the JSP has a %% character
           Product: Tomcat 4
           Version: 4.1.12
          Platform: PC
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Unknown
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: terencek@etechfocus.com


save the following as r1.jsp. The r1_jsp.java will create some very strange 
output see below when it hits %%.

Tomcat 4.0.4 is okay
Tomcat 4.1.12 is not okay
JDK 1.4.0_01

System: Windows NT 2000.
----------------
<%!
   public void tableHeader(JspWriter out, String sTitle, String sSubtitle)
   {
      String sHeight="15";
      String sWidth="14";
      String sColor="088000";
	/*
	out.println("<tr><td bgcolor=#808080 height="+sHeight+" rowspan=2 
nowrap><table width=140 cellpadding=0 cellspacing=0 border=0><tr><td 
width=140></td></tr></table><font 
color=white>&nbsp;&nbsp;<b>"+sTitle+"</b></font></td><td
bgcolor=#808080 
valign=top><img src=../images/tri.gif width="+sWidth+" 
height="+sHeight+"></td><td align=right width=90%%><table><tr><td

nowrap>"+sSubtitle+"</td></tr></table></td></tr>");
	*/
   }
%>
----------
Output result in r1_jsp.java
--------
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;

public class r1_jsp extends HttpJspBase {


   public void tableHeader(JspWriter out, String sTitle, String sSubtitle)
   {
      String sHeight="15";
      String sWidth="14";
      String sColor="088000";
        /*
        out.println("<tr><td bgcolor=#808080 height="+sHeight+" rowspan=2 nowrap
><table width=140 cellpadding=0 cellspacing=0 border=0><tr><td width=140></td></
tr></table><font color=white>&nbsp;&nbsp;<b>"+sTitle+"</b></font></td><td
bgcolo
r=#808080 valign=top><img src=../images/tri.gif width="+sWidth+" height="+sHeigh
t+"></td><td align=right width=90%
  private static java.util.Vector _jspx_includes;

  public java.util.List getIncludes() {
    return _jspx_includes;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse respon
se)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    javax.servlet.jsp.PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html;charset=ISO-8859-1");
      pageContext = _jspxFactory.getPageContext(this, request, response,
                        null, true, 8192, true);
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("<table>");
      out.write("<tr>");
      out.write("<td nowrap>\"+sSubtitle+\"");
      out.write("</td>");
      out.write("</tr>");
      out.write("</table>");
      out.write("</td>");
      out.write("</tr>\");\r\n\t*/\r\n   }\r\n%>\r\n\r\n");
    } catch (Throwable t) {
      out = _jspx_out;
      if (out != null && out.getBufferSize() != 0)
        out.clearBuffer();
      if (pageContext != null) pageContext.handlePageException(t);
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
    }
  }
}

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


Mime
View raw message