yoavs       2004/10/22 09:51:23

  Modified:    webapps/docs Tag: TOMCAT_5_0 changelog.xml jasper-howto.xml
               jasper2/src/share/org/apache/jasper Tag: TOMCAT_5_0
                        EmbeddedServletOptions.java JspC.java Options.java
               jasper2/src/share/org/apache/jasper/compiler Tag: TOMCAT_5_0
                        Compiler.java
  Log:
  Committed patches from Jess Holle to add a compilerTargetVM option to Jasper, JspC, 
and make its default 1.3 to match the default 1.3 compilerSourceVM setting.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.70.2.54 +6 -0      jakarta-tomcat-catalina/webapps/docs/changelog.xml
  
  Index: changelog.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/changelog.xml,v
  retrieving revision 1.70.2.53
  retrieving revision 1.70.2.54
  diff -u -r1.70.2.53 -r1.70.2.54
  --- changelog.xml     14 Oct 2004 17:33:30 -0000      1.70.2.53
  +++ changelog.xml     22 Oct 2004 16:51:22 -0000      1.70.2.54
  @@ -38,6 +38,12 @@
   
     <subsection name="Jasper">
       <changelog>
  +      <fix>
  +        Fixed default compiler target VM setting (to 1.3) so that compilation on 
J2SE 5.0 works out of the box. (yoavs)
  +      </fix>
  +      <update>
  +        Exposed compilerSourceVM and compilerTargetVM options to JspC. (yoavs)
  +      </update>
       </changelog>
     </subsection>
   
  
  
  
  1.13.2.1  +4 -0      jakarta-tomcat-catalina/webapps/docs/jasper-howto.xml
  
  Index: jasper-howto.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/jasper-howto.xml,v
  retrieving revision 1.13
  retrieving revision 1.13.2.1
  diff -u -r1.13 -r1.13.2.1
  --- jasper-howto.xml  17 Mar 2004 00:09:22 -0000      1.13
  +++ jasper-howto.xml  22 Oct 2004 16:51:22 -0000      1.13.2.1
  @@ -85,6 +85,10 @@
   generated servlets?  By default the classpath is created dynamically based on
   the current web application.</li>
   
  +<li><strong>compilerSourceVM</strong> - What JDK version is the source compatible 
with.  By default this is 1.3.</li>
  +
  +<li><strong>compilerTargetVM</strong> - What JDK version should the generated files 
be compatible with.  By default this is also 1.3.</li>
  +
   <li><strong>development</strong> - Is Jasper used in development mode (will
   check for JSP modification on every access)? <code>true</code> or
   <code>false</code>, default <code>true</code>.</li>
  
  
  
  No                   revision
  No                   revision
  1.10.2.3  +17 -0     
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.10.2.2
  retrieving revision 1.10.2.3
  diff -u -r1.10.2.2 -r1.10.2.3
  --- EmbeddedServletOptions.java       2 Sep 2004 16:08:03 -0000       1.10.2.2
  +++ EmbeddedServletOptions.java       22 Oct 2004 16:51:23 -0000      1.10.2.3
  @@ -144,6 +144,11 @@
       private String compilerTargetVM = "1.3";
   
       /**
  +     * The compiler source VM ("1.3" by default).
  +     */
  +    private String compilerSourceVM = "1.3";
  +
  +    /**
        * Cache for the TLD locations
        */
       private TldLocationsCache tldLocationsCache = null;
  @@ -303,6 +308,13 @@
           return compilerTargetVM;
       }
   
  +    /**
  +     * @see Options#getCompilerSourceVM
  +     */
  +    public String getCompilerSourceVM() {
  +        return compilerSourceVM;
  +    }
  +
       public boolean getErrorOnUseBeanInvalidClassAttribute() {
           return errorOnUseBeanInvalidClassAttribute;
       }
  @@ -569,6 +581,11 @@
           String compilerTargetVM = config.getInitParameter("compilerTargetVM");
           if(compilerTargetVM != null) {
               this.compilerTargetVM = compilerTargetVM;
  +        }
  +
  +        String compilerSourceVM = config.getInitParameter("compilerSourceVM");
  +        if(compilerSourceVM != null) {
  +          this.compilerSourceVM = compilerSourceVM;
           }
   
           String javaEncoding = config.getInitParameter("javaEncoding");
  
  
  
  1.80.2.3  +22 -2     
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.80.2.2
  retrieving revision 1.80.2.3
  diff -u -r1.80.2.2 -r1.80.2.3
  --- JspC.java 2 Sep 2004 16:08:03 -0000       1.80.2.2
  +++ JspC.java 22 Oct 2004 16:51:23 -0000      1.80.2.3
  @@ -98,6 +98,8 @@
       private static final String SWITCH_CLASS_NAME = "-c";
       private static final String SWITCH_FULL_STOP = "--";
       private static final String SWITCH_COMPILE = "-compile";
  +    private static final String SWITCH_SOURCE = "-source";
  +    private static final String SWITCH_TARGET = "-target";
       private static final String SWITCH_URI_BASE = "-uribase";
       private static final String SWITCH_URI_ROOT = "-uriroot";
       private static final String SWITCH_FILE_WEBAPP = "-webapp";
  @@ -145,6 +147,7 @@
   
       private String compiler = null;
       private String compilerTargetVM = "1.3";
  +    private String compilerSourceVM = "1.3";
   
       private boolean classDebugInfo = true;
       private Vector extensions;
  @@ -276,6 +279,10 @@
                   }
               } else if (tok.equals(SWITCH_ENCODING)) {
                   setJavaEncoding(nextArg());
  +            } else if (tok.equals(SWITCH_SOURCE)) {
  +                setCompilerSourceVM(nextArg());
  +            } else if (tok.equals(SWITCH_TARGET)) {
  +                setCompilerTargetVM(nextArg());
               } else {
                   if (tok.startsWith("-")) {
                       throw new JasperException("Unrecognized option: " + tok +
  @@ -479,8 +486,22 @@
           compilerTargetVM = vm;
       }
   
  +    /**
  +     * @see Options#getCompilerSourceVM.
  +     */
  +    public String getCompilerSourceVM() {
  +        return compilerSourceVM;
  +    }
  +        
  +    /**
  +     * @see Options#getCompilerSourceVM.
  +     */
  +    public void setCompilerSourceVM(String vm) {
  +        compilerSourceVM = vm;
  +    }     
  +
       public TldLocationsCache getTldLocationsCache() {
  -    return tldLocationsCache;
  +        return tldLocationsCache;
       }
   
       /**
  @@ -1156,5 +1177,4 @@
               // pass straight through
           }
       }
  -
   }
  
  
  
  1.23.2.2  +6 -1      
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.23.2.1
  retrieving revision 1.23.2.2
  diff -u -r1.23.2.1 -r1.23.2.2
  --- Options.java      2 Sep 2004 15:19:26 -0000       1.23.2.1
  +++ Options.java      22 Oct 2004 16:51:23 -0000      1.23.2.2
  @@ -117,9 +117,14 @@
       public String getCompiler();
   
       /**
  -     * Compiler target VM, e.g. 1.1,1.2,1.3, or 1.4.
  +     * Compiler target VM, e.g. 1.1,1.2,1.3,1.4, or 1.5.
        */
       public String getCompilerTargetVM();
  +
  +    /**
  +     * Compiler source VM, e.g. 1.3, 1.4, or 1.5.
  +     */
  +    public String getCompilerSourceVM();    
   
       /**
        * The cache for the location of the TLD's
  
  
  
  No                   revision
  No                   revision
  1.88.2.4  +5 -0      
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java
  
  Index: Compiler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v
  retrieving revision 1.88.2.3
  retrieving revision 1.88.2.4
  diff -u -r1.88.2.3 -r1.88.2.4
  --- Compiler.java     21 Sep 2004 19:45:09 -0000      1.88.2.3
  +++ Compiler.java     22 Oct 2004 16:51:23 -0000      1.88.2.4
  @@ -386,6 +386,11 @@
               info.append("   compilerTargetVM=" + options.getCompilerTargetVM() + 
"\n");
           }
   
  +        if (options.getCompilerSourceVM() != null) {
  +            javac.setSource(options.getCompilerSourceVM());
  +            info.append("   compilerSourceVM=" + options.getCompilerSourceVM() + 
"\n");
  +        }
  +
           // Build includes path
           PatternSet.NameEntry includes = javac.createInclude();
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to