costin      01/12/16 21:18:45

  Modified:    src/share/org/apache/jasper JspC.java
  Log:
  Small fix - set the context class loader.
  
  Revision  Changes    Path
  1.24      +14 -1     jakarta-tomcat/src/share/org/apache/jasper/JspC.java
  
  Index: JspC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/JspC.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- JspC.java 2001/09/08 20:09:39     1.23
  +++ JspC.java 2001/12/17 05:18:45     1.24
  @@ -70,6 +70,7 @@
   import org.apache.jasper.servlet.JasperLoader;
   
   import org.apache.tomcat.util.log.*;
  +import org.apache.tomcat.util.compat.*;
   
   /**
    * Shell for the jspc compiler.  Handles all options associated with the 
  @@ -331,8 +332,11 @@
   //         Constants.jasperLog.setLogger( ql );
   
       }
  +
  +    static Jdk11Compat jdkCompat=Jdk11Compat.getJdkCompat();
       
  -    public boolean parseFile(PrintStream log, String file, Writer servletout, 
Writer mappingout)
  +    public boolean parseFile(PrintStream log, String file, Writer servletout,
  +                          Writer mappingout)
       {
           try {
               JasperLoader loader =
  @@ -342,6 +346,11 @@
               CommandLineContext clctxt = new CommandLineContext(
                       loader, getClassPath(), file, uriBase, uriRoot, false,
                       this);
  +
  +         // Same execution env. as in 'normal' jasper
  +         // Some tags may need it ( at compile time )
  +         jdkCompat.setContextClassLoader(loader);
  +         
               if ((targetClassName != null) && (targetClassName.length() > 0)) {
                   clctxt.setServletClassName(targetClassName);
                   clctxt.lockClassName();
  @@ -406,6 +415,9 @@
               //je.printStackTrace(log);
               Constants.message("jspc.error.jasperException", 
                       new Object[] {file, je}, Log.ERROR);
  +         je.printStackTrace();
  +         if( je.getRootCause() != null )
  +             je.getRootCause().printStackTrace();
               if (dieLevel != NO_DIE_LEVEL) {
                   dieOnExit = true;
               }
  @@ -415,6 +427,7 @@
           } catch (Exception e) {
               Constants.message("jspc.error.generalException", 
                       new Object[] {file, e}, Log.ERROR);
  +         e.printStackTrace();
               if (dieLevel != NO_DIE_LEVEL) {
                   dieOnExit = true;
               }
  
  
  

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

Reply via email to