javax.servlet.jsp.JspApplicationContext Java Examples

The following examples show how to use javax.servlet.jsp.JspApplicationContext. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JspContextWrapper.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Override
public ELContext getELContext() {
    if (elContext == null) {
        elContext = new ELContextWrapper(rootJspCtxt.getELContext(), jspTag, this);
        JspFactory factory = JspFactory.getDefaultFactory();
        JspApplicationContext jspAppCtxt = factory.getJspApplicationContext(servletContext);
        if (jspAppCtxt instanceof JspApplicationContextImpl) {
            ((JspApplicationContextImpl) jspAppCtxt).fireListeners(elContext);
        }
    }
    return elContext;
}
 
Example #2
Source File: JspFactoryImpl.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Override
public JspApplicationContext getJspApplicationContext(
        final ServletContext context) {
    if (Constants.IS_SECURITY_ENABLED) {
        return AccessController.doPrivileged(
                new PrivilegedAction<JspApplicationContext>() {
            @Override
            public JspApplicationContext run() {
                return JspApplicationContextImpl.getInstance(context);
            }
        });
    } else {
        return JspApplicationContextImpl.getInstance(context);
    }
}
 
Example #3
Source File: JspFactoryImpl.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
@Override
public JspApplicationContext getJspApplicationContext(
        final ServletContext context) {
    if (Constants.IS_SECURITY_ENABLED) {
        return AccessController.doPrivileged(
                new PrivilegedAction<JspApplicationContext>() {
            @Override
            public JspApplicationContext run() {
                return JspApplicationContextImpl.getInstance(context);
            }
        });
    } else {
        return JspApplicationContextImpl.getInstance(context);
    }
}
 
Example #4
Source File: JspFactoryImpl.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
@Override
public JspApplicationContext getJspApplicationContext(
        final ServletContext context) {
    if (Constants.IS_SECURITY_ENABLED) {
        return AccessController.doPrivileged(
                new PrivilegedAction<JspApplicationContext>() {
            @Override
            public JspApplicationContext run() {
                return JspApplicationContextImpl.getInstance(context);
            }
        });
    } else {
        return JspApplicationContextImpl.getInstance(context);
    }
}
 
Example #5
Source File: OpenEJBLifecycle.java    From tomee with Apache License 2.0 5 votes vote down vote up
/**
 * On Tomcat we need to sometimes force a class load to get our hands on the JspFactory
 */
private static void setJspELFactory(ServletContext startupObject, ELResolver resolver)
{
    JspFactory factory = JspFactory.getDefaultFactory();
    if (factory == null)
    {
        try
        {
            try {
                Class.forName("org.apache.jasper.servlet.JasperInitializer");
            } catch (final Throwable th) {
                Class.forName("org.apache.jasper.compiler.JspRuntimeContext");
            }
            factory = JspFactory.getDefaultFactory();
        }
        catch (Exception e)
        {
            // ignore
        }

    }

    if (factory != null)
    {
        JspApplicationContext applicationCtx = factory.getJspApplicationContext(startupObject);
        applicationCtx.addELResolver(resolver);
    }
    else
    {
        logger.debug("Default JSPFactroy instance has not found. Skipping OWB JSP handling");
    }
}
 
Example #6
Source File: JspFactoryImpl.java    From packagedrone with Eclipse Public License 1.0 4 votes vote down vote up
public JspApplicationContext getJspApplicationContext
        (ServletContext context) {
    return JspApplicationContextImpl.findJspApplicationContext(context);
}