costin      01/03/01 22:56:20

  Modified:    src/share/org/apache/jasper/runtime JspFactoryImpl.java
                        JspWriterImpl.java
  Log:
  Removed dependency on tomcat.util.compat - the runtime can be set up
  without it.
  
  The trick ( not a trick actually ) is to do the actions needed
  special priviledge when the system is initialized ( i.e. JspFactoryImpl
  is created and set into JspFactory ).
  
  No other priviledged are required so far in the runtime.
  
  Revision  Changes    Path
  1.10      +15 -3     
jakarta-tomcat/src/share/org/apache/jasper/runtime/JspFactoryImpl.java
  
  Index: JspFactoryImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspFactoryImpl.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JspFactoryImpl.java       2001/03/02 04:51:40     1.9
  +++ JspFactoryImpl.java       2001/03/02 06:56:19     1.10
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspFactoryImpl.java,v 1.9 
2001/03/02 04:51:40 costin Exp $
  - * $Revision: 1.9 $
  - * $Date: 2001/03/02 04:51:40 $
  + * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspFactoryImpl.java,v 
1.10 2001/03/02 06:56:19 costin Exp $
  + * $Revision: 1.10 $
  + * $Date: 2001/03/02 06:56:19 $
    *
    * ====================================================================
    * 
  @@ -80,6 +80,18 @@
   public class JspFactoryImpl extends JspFactory {
       private SimplePool pool=new SimplePool( 100 );
       private static final boolean usePool=true;
  +    static String lineSeparator;
  +    static {
  +     try {
  +         lineSeparator =  System.getProperty("line.separator");
  +     } catch( Exception ex ) {
  +         lineSeparator="\r\n";
  +     }
  +     // This whole things allows us to set the writer line
  +     // separator when we init jasper, i.e. in priv. mode -
  +     // without it we would need a priviledged action.
  +     JspWriterImpl.lineSeparator=lineSeparator;
  +    }
       
       Log loghelper = Log.getLog("JASPER_LOG", "JspFactoryImpl");
       
  
  
  
  1.7       +5 -12     
jakarta-tomcat/src/share/org/apache/jasper/runtime/JspWriterImpl.java
  
  Index: JspWriterImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspWriterImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JspWriterImpl.java        2001/03/02 04:51:41     1.6
  +++ JspWriterImpl.java        2001/03/02 06:56:19     1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspWriterImpl.java,v 1.6 
2001/03/02 04:51:41 costin Exp $
  - * $Revision: 1.6 $
  - * $Date: 2001/03/02 04:51:41 $
  + * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspWriterImpl.java,v 1.7 
2001/03/02 06:56:19 costin Exp $
  + * $Revision: 1.7 $
  + * $Date: 2001/03/02 06:56:19 $
    *
    * ====================================================================
    * 
  @@ -72,7 +72,6 @@
   import javax.servlet.jsp.JspWriter;
   
   import org.apache.jasper.Constants;
  -import org.apache.tomcat.util.compat.*;
   
   /**
    * Write text to a character-output stream, buffering characters so as
  @@ -382,18 +381,12 @@
        write(s, 0, s.length());
       }
   
  -
       static String lineSeparator;
       static {
  -     Jdk11Compat jdk11Compat=Jdk11Compat.getJdkCompat();
        try {
  -         lineSeparator = (String)jdk11Compat.doPrivileged( new Action() {
  -                 public Object run() throws Exception {
  -                     return System.getProperty("line.separator");
  -                 }
  -             });
  +         lineSeparator =  System.getProperty("line.separator");
        } catch( Exception ex ) {
  -         lineSeparator="\r\r";
  +         lineSeparator="\r\n";
        }
       }
   
  
  
  

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

Reply via email to