Search in sources :

Example 1 with ELAdaptor

use of org.apache.webbeans.spi.adaptor.ELAdaptor in project tomee by apache.

the class OpenEJBLifecycle method initializeServletContext.

public static void initializeServletContext(final ServletContext servletContext, final WebBeansContext context) {
    if (context == null || !context.getBeanManagerImpl().isInUse()) {
        return;
    }
    final ELAdaptor elAdaptor = context.getService(ELAdaptor.class);
    final ELResolver resolver = elAdaptor.getOwbELResolver();
    //Application is configured as JSP
    if (context.getOpenWebBeansConfiguration().isJspApplication()) {
        logger.debug("Application is configured as JSP. Adding EL Resolver.");
        setJspELFactory(servletContext, resolver);
    }
    // Add BeanManager to the 'javax.enterprise.inject.spi.BeanManager' servlet context attribute
    servletContext.setAttribute(BeanManager.class.getName(), context.getBeanManagerImpl());
}
Also used : ELResolver(javax.el.ELResolver) BeanManager(javax.enterprise.inject.spi.BeanManager) ELAdaptor(org.apache.webbeans.spi.adaptor.ELAdaptor)

Aggregations

ELResolver (javax.el.ELResolver)1 BeanManager (javax.enterprise.inject.spi.BeanManager)1 ELAdaptor (org.apache.webbeans.spi.adaptor.ELAdaptor)1