tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kin...@apache.org
Subject cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler SmapUtil.java
Date Thu, 17 Apr 2003 00:32:02 GMT
kinman      2003/04/16 17:32:02

  Modified:    jasper2/src/share/org/apache/jasper
                        EmbeddedServletOptions.java JspC.java Options.java
               jasper2/src/share/org/apache/jasper/compiler SmapUtil.java
  Log:
  - Now that Smap is generated in memory, implement a compiler option to
    to dump it to file, for debugging
  
  Revision  Changes    Path
  1.2       +28 -3     jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbeddedServletOptions.java
  
  Index: EmbeddedServletOptions.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbeddedServletOptions.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EmbeddedServletOptions.java	29 Mar 2003 02:15:18 -0000	1.1
  +++ EmbeddedServletOptions.java	17 Apr 2003 00:32:02 -0000	1.2
  @@ -157,6 +157,11 @@
       private boolean suppressSmap = false;
   
       /**
  +     * Should SMAP info for JSR45 debugging be dumped to a file?
  +     */
  +    private boolean dumpSmap = false;
  +
  +    /**
        * I want to see my generated servlets. Which directory are they
        * in?
        */
  @@ -285,6 +290,13 @@
       }
   
       /**
  +     * Should SMAP info for JSR45 debugging be dumped to a file?
  +     */
  +    public boolean dumpSmap() {
  +        return dumpSmap;
  +    }
  +
  +    /**
        * Class ID for use in the plugin tag when the browser is IE. 
        */
       public String getIeClassId() {
  @@ -509,6 +521,19 @@
               } else {
                   if (log.isWarnEnabled()) {
                       log.warn(Localizer.getMessage("jsp.warning.suppressSmap"));
  +                }
  +            }
  +        }
  +
  +        String dumpSmap = config.getInitParameter("dumpSmap");
  +        if (dumpSmap != null) {
  +            if (dumpSmap.equalsIgnoreCase("true")) {
  +                this.dumpSmap = true;
  +            } else if (dumpSmap.equalsIgnoreCase("false")) {
  +                this.dumpSmap = false;
  +            } else {
  +                if (log.isWarnEnabled()) {
  +                    log.warn(Localizer.getMessage("jsp.warning.dumpSmap"));
                   }
               }
           }
  
  
  
  1.40      +10 -3     jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java
  
  Index: JspC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- JspC.java	11 Apr 2003 22:41:57 -0000	1.39
  +++ JspC.java	17 Apr 2003 00:32:02 -0000	1.40
  @@ -349,6 +349,13 @@
   	return true;
       }
   
  +   /**
  +     * Should SMAP info for JSR45 debugging be dumped to a file?
  +     */
  +    public boolean dumpSmap() {
  +	return false;
  +    }
  +
       public String getIeClassId() {
           return ieClassId;
       }
  
  
  
  1.13      +10 -4     jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Options.java
  
  Index: Options.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Options.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Options.java	24 Feb 2003 19:39:38 -0000	1.12
  +++ Options.java	17 Apr 2003 00:32:02 -0000	1.13
  @@ -130,9 +130,15 @@
       public boolean getReloading();
   
       /**
  -     * Is the generation of SMAP info for JSR45 debuggin suppressed?
  +     * Is the generation of SMAP info for JSR45 debugging suppressed?
        */
       public boolean suppressSmap();
  +
  +    /**
  +     * Should SMAP info for JSR45 debugging be dumped to a file?
  +     * Ignored is suppressSmap() is true
  +     */
  +    public boolean dumpSmap();
   
       /**
        * Class ID for use in the plugin tag when the browser is IE. 
  
  
  
  1.11      +9 -2      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/SmapUtil.java
  
  Index: SmapUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/SmapUtil.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- SmapUtil.java	16 Apr 2003 21:50:48 -0000	1.10
  +++ SmapUtil.java	17 Apr 2003 00:32:02 -0000	1.11
  @@ -123,8 +123,15 @@
           evaluateNodes(pageNodes, s);
           g.addStratum(s, true);
   
  -//	System.out.println(g.getString());
  -	return g.getString();
  +        if (ctxt.getOptions().dumpSmap()) {
  +            File outSmap = new File(ctxt.getClassFileName() + ".smap");
  +            PrintWriter so = new PrintWriter(
  +                new OutputStreamWriter(new FileOutputStream(outSmap),
  +                                   SMAP_ENCODING));
  +            so.print(g.getString());
  +            so.close();
  +        }
  +        return g.getString();
       }
       
       public static void installSmap(String classFileName, String smap)
  
  
  

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


Mime
View raw message