}
out.printin(VAR_EXPRESSIONFACTORY);
- out.print(" = JspFactory.getDefaultFactory().getJspApplicationContext(");
+ out.print(" = _jspxFactory.getJspApplicationContext(");
if (ctxt.isTagFile()) {
out.print("config");
} else {
* preamble generation)
*/
private void genPreambleStaticInitializers() throws JasperException {
+ out.printil("private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();");
+ out.println();
+
// Static data for getDependants()
out.printil("private static java.util.List _jspx_dependants;");
out.println();
out.println();
// Local variable declarations
- out.printil("JspFactory _jspxFactory = null;");
out.printil("PageContext pageContext = null;");
if (pageInfo.isSession())
out.printil("try {");
out.pushIndent();
- out.printil("_jspxFactory = JspFactory.getDefaultFactory();");
-
out.printin("response.setContentType(");
out.print(quote(pageInfo.getContentType()));
out.println(");");
out.pushIndent();
out
- .printil("if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);");
+ .printil("_jspxFactory.releasePageContext(_jspx_page_context);");
out.popIndent();
out.printil("}");
static {
JspFactoryImpl factory = new JspFactoryImpl();
SecurityClassLoad.securityClassLoad(factory.getClass().getClassLoader());
+ 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) {
+ throw new IllegalStateException(ex);
+ }
+ }
+
JspFactory.setDefaultFactory(factory);
}
{
- 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) {
- org.apache.juli.logging.LogFactory.getLog( HttpJspBase.class )
- .error("Jasper JspRuntimeContext preload of class failed: " +
- ex.getMessage(), ex);
- }
- }
- JspFactory.setDefaultFactory(factory);
- }
- }
-
protected HttpJspBase() {
}