costin      2002/06/14 13:45:55

  Modified:    jasper2/src/share/org/apache/jasper/runtime HttpJspBase.java
  Log:
  Added a check if JspFactory is set, and set it if not.
  
  If compiled jsps are used, JspRuntimeContext is not started ( since JspServlet
  is never invoked, and there is no .jsp to check ), and we need the factory.
  
  Revision  Changes    Path
  1.3       +27 -0     
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/HttpJspBase.java
  
  Index: HttpJspBase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/HttpJspBase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- HttpJspBase.java  6 May 2002 04:33:15 -0000       1.2
  +++ HttpJspBase.java  14 Jun 2002 20:45:55 -0000      1.3
  @@ -81,6 +81,33 @@
       implements HttpJspPage 
   {
       protected PageContext pageContext;
  +    static {
  +        if( JspFactory.getDefaultFactory() == null ) {
  +            JspFactoryImpl factory = new JspFactoryImpl();
  +            if( System.getSecurityManager() != null ) {
  +                String basePackage = "org.apache.jasper.";
  +                try {
  +                    factory.getClass().getClassLoader().loadClass( basePackage +
  +                                                                   
"runtime.JspFactoryImpl$PrivilegedGetPageContext");
  +                    factory.getClass().getClassLoader().loadClass( basePackage +
  +                                                                   
"runtime.JspFactoryImpl$PrivilegedReleasePageContext");
  +                    factory.getClass().getClassLoader().loadClass( basePackage +
  +                                                                   
"runtime.JspRuntimeLibrary");
  +                    factory.getClass().getClassLoader().loadClass( basePackage +
  +                                                                   
"runtime.JspRuntimeLibrary$PrivilegedIntrospectHelper");
  +                    factory.getClass().getClassLoader().loadClass( basePackage +
  +                                                                   
"runtime.ServletResponseWrapperInclude");
  +                    factory.getClass().getClassLoader().loadClass( basePackage +
  +                                                                   
"servlet.JspServletWrapper");
  +                } catch (ClassNotFoundException ex) {
  +                    System.out.println(
  +                                       "Jasper JspRuntimeContext preload of class 
failed: " +
  +                                       ex.getMessage());
  +                }
  +            }
  +            JspFactory.setDefaultFactory(factory);
  +        }
  +    }
   
       protected HttpJspBase() {
       }
  
  
  

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

Reply via email to