View | Details | Raw Unified | Return to bug 41558
Collapse All | Expand All

(-)org/apache/jasper/compiler/Generator.java (-5 / +5 lines)
Lines 402-408 Link Here
402
        }
402
        }
403
        
403
        
404
        out.printin(VAR_EXPRESSIONFACTORY);
404
        out.printin(VAR_EXPRESSIONFACTORY);
405
        out.print(" = JspFactory.getDefaultFactory().getJspApplicationContext(");
405
        out.print(" = _jspxFactory.getJspApplicationContext(");
406
        if (ctxt.isTagFile()) {
406
        if (ctxt.isTagFile()) {
407
            out.print("config");
407
            out.print("config");
408
        } else {
408
        } else {
Lines 477-482 Link Here
477
     * preamble generation)
477
     * preamble generation)
478
     */
478
     */
479
    private void genPreambleStaticInitializers() throws JasperException {
479
    private void genPreambleStaticInitializers() throws JasperException {
480
        out.printil("private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();");
481
        out.println();
482
480
        // Static data for getDependants()
483
        // Static data for getDependants()
481
        out.printil("private static java.util.List _jspx_dependants;");
484
        out.printil("private static java.util.List _jspx_dependants;");
482
        out.println();
485
        out.println();
Lines 594-600 Link Here
594
        out.println();
597
        out.println();
595
598
596
        // Local variable declarations
599
        // Local variable declarations
597
        out.printil("JspFactory _jspxFactory = null;");
598
        out.printil("PageContext pageContext = null;");
600
        out.printil("PageContext pageContext = null;");
599
601
600
        if (pageInfo.isSession())
602
        if (pageInfo.isSession())
Lines 624-631 Link Here
624
        out.printil("try {");
626
        out.printil("try {");
625
        out.pushIndent();
627
        out.pushIndent();
626
628
627
        out.printil("_jspxFactory = JspFactory.getDefaultFactory();");
628
629
        out.printin("response.setContentType(");
629
        out.printin("response.setContentType(");
630
        out.print(quote(pageInfo.getContentType()));
630
        out.print(quote(pageInfo.getContentType()));
631
        out.println(");");
631
        out.println(");");
Lines 3307-3313 Link Here
3307
        out.pushIndent();
3307
        out.pushIndent();
3308
3308
3309
        out
3309
        out
3310
                .printil("if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);");
3310
                .printil("_jspxFactory.releasePageContext(_jspx_page_context);");
3311
3311
3312
        out.popIndent();
3312
        out.popIndent();
3313
        out.printil("}");
3313
        out.printil("}");
(-)org/apache/jasper/compiler/JspRuntimeContext.java (+22 lines)
Lines 72-77 Link Here
72
    static {
72
    static {
73
        JspFactoryImpl factory = new JspFactoryImpl();
73
        JspFactoryImpl factory = new JspFactoryImpl();
74
        SecurityClassLoad.securityClassLoad(factory.getClass().getClassLoader());
74
        SecurityClassLoad.securityClassLoad(factory.getClass().getClassLoader());
75
        if( System.getSecurityManager() != null ) {
76
            String basePackage = "org.apache.jasper.";
77
            try {
78
                factory.getClass().getClassLoader().loadClass( basePackage +
79
                                                               "runtime.JspFactoryImpl$PrivilegedGetPageContext");
80
                factory.getClass().getClassLoader().loadClass( basePackage +
81
                                                               "runtime.JspFactoryImpl$PrivilegedReleasePageContext");
82
                factory.getClass().getClassLoader().loadClass( basePackage +
83
                                                               "runtime.JspRuntimeLibrary");
84
                factory.getClass().getClassLoader().loadClass( basePackage +
85
                                                               "runtime.JspRuntimeLibrary$PrivilegedIntrospectHelper");
86
                factory.getClass().getClassLoader().loadClass( basePackage +
87
                                                               "runtime.ServletResponseWrapperInclude");
88
                factory.getClass().getClassLoader().loadClass( basePackage +
89
                                                               "servlet.JspServletWrapper");
90
            } catch (ClassNotFoundException ex) {
91
                org.apache.juli.logging.LogFactory.getLog( HttpJspBase.class )
92
                    .error("Jasper JspRuntimeContext preload of class failed: " +
93
                                   ex.getMessage(), ex);
94
            }
95
        }
96
75
        JspFactory.setDefaultFactory(factory);
97
        JspFactory.setDefaultFactory(factory);
76
    }
98
    }
77
99
(-)org/apache/jasper/runtime/HttpJspBase.java (-28 lines)
Lines 41-74 Link Here
41
    
41
    
42
{
42
{
43
    
43
    
44
    static {
45
        if( JspFactory.getDefaultFactory() == null ) {
46
            JspFactoryImpl factory = new JspFactoryImpl();
47
            if( System.getSecurityManager() != null ) {
48
                String basePackage = "org.apache.jasper.";
49
                try {
50
                    factory.getClass().getClassLoader().loadClass( basePackage +
51
                                                                   "runtime.JspFactoryImpl$PrivilegedGetPageContext");
52
                    factory.getClass().getClassLoader().loadClass( basePackage +
53
                                                                   "runtime.JspFactoryImpl$PrivilegedReleasePageContext");
54
                    factory.getClass().getClassLoader().loadClass( basePackage +
55
                                                                   "runtime.JspRuntimeLibrary");
56
                    factory.getClass().getClassLoader().loadClass( basePackage +
57
                                                                   "runtime.JspRuntimeLibrary$PrivilegedIntrospectHelper");
58
                    factory.getClass().getClassLoader().loadClass( basePackage +
59
                                                                   "runtime.ServletResponseWrapperInclude");
60
                    factory.getClass().getClassLoader().loadClass( basePackage +
61
                                                                   "servlet.JspServletWrapper");
62
                } catch (ClassNotFoundException ex) {
63
                    org.apache.juli.logging.LogFactory.getLog( HttpJspBase.class )
64
                        .error("Jasper JspRuntimeContext preload of class failed: " +
65
                                       ex.getMessage(), ex);
66
                }
67
            }
68
            JspFactory.setDefaultFactory(factory);
69
        }
70
    }
71
72
    protected HttpJspBase() {
44
    protected HttpJspBase() {
73
    }
45
    }
74
46

Return to bug 41558