tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian P Millett <...@ec-group.com>
Subject Jasper bug?? & patch
Date Fri, 02 Jun 2000 19:10:23 GMT
My setup info:
SunOS shaka 5.8 Generic i86pc i386 i86pc
Solaris VM (build Solaris_JDK_1.2.2_05a, native threads, sunwjit)
Cocoon-1.7.4
jaxp1.0.1
Apache/1.3.12 (Unix) ApacheJServ/1.1.1 mod_perl/1.24
secured_by_Raven/1.4.3


I just installed Tomcat from the CVS repository (6/1/2000) and noticed
that the jsp examples were being generated in an infinite loop.  Meaning
that it was filling up my file system trying to run the "date" example.
Looking at teh code generated shows the following

package jsp.dates;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.FileInputStream;
import java.io.ObjectInputStream;
import java.util.Vector;
import org.apache.jasper.runtime.*;
import java.beans.*;
import org.apache.jasper.JasperException;


public class _0002fjsp_0002fdates_0002fdate_0002ejspdate_jsp_0 extends
HttpJspBase {

    // begin
[file="/opt/apache/jakarta-tomcat/webapps/examples/jsp/dates/date.jsp";from=(9,0);to=(9,90)]

    // end

    static {
    }
    public _0002fjsp_0002fdates_0002fdate_0002ejspdate_jsp_0( ) {
    }

    private static boolean _jspx_inited = false;

    public final void _jspx_init() throws JasperException {
    }

    public void _jspService(HttpServletRequest request,
HttpServletResponse  response)
        throws IOException, ServletException {

        JspFactory _jspxFactory = null;
        PageContext pageContext = null;
        ServletContext application = null;
        ServletConfig config = null;
        JspWriter out = null;
        Object page = this;
        String  _value = null;
        try {

            if (_jspx_inited == false) {
                _jspx_init();
                _jspx_inited = true;
            }
            _jspxFactory = JspFactory.getDefaultFactory();
            response.setContentType("text/html;charset=8859_1");
            pageContext = _jspxFactory.getPageContext(this, request,
response,
                        "", false, 8192, true);

            application = pageContext.getServletContext();
            config = pageContext.getServletConfig();
            out = pageContext.getOut();

            // HTML // begin
[file="/opt/apache/jakarta-tomcat/webapps/examples/jsp/dates/date.jsp";from=(0,0);to=(6,0)]

                out.write("<html>\r\n<!--\r\n  Copyright (c) 1999 The
Apache Software Foundation.  All rights \r\n
reserved.\r\n-->\r\n\r\n");
out.write("<html>\r\n<!--\r\n  Copyright (c) 1999 The Apache Software
Foundation.  All rights \r\n  reserved.\r\n-->\r\n\r\n");
out.write("<html>\r\n<!--\r\n  Copyright (c) 1999 The Apache Software
Foundation.  All rights \r\n  reserved.\r\n-->\r\n\r\n");
out.write("<html>\r\n<!--\r\n  Copyright (c) 1999 The Apache Software
Foundation.  All rights \r\n  reserved.\r\n-->\r\n\r\n");
out.write("<html>\r\n<!--\r\n  Copyright (c) 1999 The Apache Software
Foundation.  All rights \r\n  reserved.\r\n-->\r\n\r\n");
out.write("<html>\r\n<!--\r\n  Copyright (c) 1999 The Apache Software
Foundation.  All rights \r\n  reserved.\r\n-->\r\n\r\n");
out.write("<html>\r\n<!--\r\n  Copyright (c) 1999 The Apache Software
Foundation.  All rights \r\n  reserved.\r\n-->\r\n\r\n");


This patch fixes the problem.  But I don't know why this was a problem
:-(


shaka: diff -wc src/share/org/apache/jasper/compiler/CharDataGenerator.java.orig src/share/org/apache/jasper/compiler/CharDataGenerator.java
*** src/share/org/apache/jasper/compiler/CharDataGenerator.java.orig    Fri Jun  2 14:07:08
2000
--- src/share/org/apache/jasper/compiler/CharDataGenerator.java Fri Jun  2 13:36:44 2000
***************
*** 90,95 ****
--- 90,96 ----
                        int to = Math.min(current + MAXSIZE, limit);
                        generateChunk(writer, from, to);
                        current = to;
+                       writer.println();
                }
      }

--
Brian Millett
Enterprise Consulting Group     "Shifts in paradigms
(314) 205-9030                     often cause nose bleeds."
bpm@ec-group.com                   Greg Glenn




Mime
View raw message