Examples of JspApplicationContext


Examples of javax.servlet.jsp.JspApplicationContext

        //Application is configured as JSP
        if(OpenWebBeansConfiguration.getInstance().isJspApplication())
        {
            logger.debug("Application is configured as JSP. Adding EL Resolver.");

            JspApplicationContext applicationCtx = JspFactory.getDefaultFactory().getJspApplicationContext((ServletContext)(startupObject));
            applicationCtx.addELResolver(resolver);
        }

        // Add BeanManager to the 'javax.enterprise.inject.spi.BeanManager' servlet context attribute
        ServletContext servletContext = (ServletContext)(startupObject);
        servletContext.setAttribute(BeanManager.class.getName(), getBeanManager());
View Full Code Here

Examples of javax.servlet.jsp.JspApplicationContext

        //Application is configured as JSP
        if(OpenWebBeansConfiguration.getInstance().isJspApplication())
        {
            logger.debug("Application is configured as JSP. Adding EL Resolver.");

            JspApplicationContext applicationCtx = JspFactory.getDefaultFactory().getJspApplicationContext((ServletContext)(startupObject));
            applicationCtx.addELResolver(resolver);

            logger.debug("Application is configured as JSP. Adding EL Listener.");

            //Adding listener
            applicationCtx.addELContextListener(elContextListener);
        }

        // Add BeanManager to the 'javax.enterprise.inject.spi.BeanManager' servlet context attribute
        ServletContext servletContext = (ServletContext)(startupObject);
        servletContext.setAttribute(BeanManager.class.getName(), getBeanManager());
View Full Code Here

Examples of javax.servlet.jsp.JspApplicationContext

            JspFactory jspFactory = getJspFactory();
            if (log.isDebugEnabled())
            {
                log.debug("jspfactory = " + jspFactory);
            }
            JspApplicationContext appCtx = jspFactory.getJspApplicationContext(servletContext);

            appCtx.addELContextListener(new FacesELContextListener());

            RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(externalContext);
            runtimeConfig.setExpressionFactory(appCtx.getExpressionFactory());

            ApplicationImpl.setInitializingRuntimeConfig(runtimeConfig);

            // And configure everything
            new FacesConfigurator(externalContext).configure();
View Full Code Here

Examples of javax.servlet.jsp.JspApplicationContext

            {
                return (String) org.easymock.EasyMock.getCurrentArguments()[0];
            }
        });
       
        JspApplicationContext jspAppCtx = control.createMock(JspApplicationContext.class);
        expect(jspAppCtx.getExpressionFactory()).andReturn(expressionFactory);
        jspAppCtx.addELContextListener(isA(FacesELContextListener.class));
        expect(jspFactory.getJspApplicationContext(eq(context))).andReturn(jspAppCtx);
        jspAppCtx.addELResolver(isA(FacesCompositeELResolver.class));

        control.replay();
        initializer.initFaces(context);

        // In MYFACES-1222: The Jsp21FacesInitializer isn't practicable anymore.
View Full Code Here

Examples of javax.servlet.jsp.JspApplicationContext

        //Application is configured as JSP
        if(OpenWebBeansConfiguration.getInstance().isJspApplication())
        {
            logger.debug("Application is configured as JSP. Adding EL Resolver.");
           
            JspApplicationContext applicationCtx = JspFactory.getDefaultFactory().getJspApplicationContext(servletContext);
            applicationCtx.addELResolver(new WebBeansELResolver());           
        }
       
        long end = System.currentTimeMillis();
       
        logger.info(OWBLogConst.INFO_0002, new Object[]{Long.toString(end - begin)});
View Full Code Here

Examples of javax.servlet.jsp.JspApplicationContext

            {
                return (String) org.easymock.EasyMock.getCurrentArguments()[0];
            }
        });
       
        JspApplicationContext jspAppCtx = control.createMock(JspApplicationContext.class);
        expect(jspAppCtx.getExpressionFactory()).andReturn(expressionFactory);
        jspAppCtx.addELContextListener(isA(FacesELContextListener.class));
        expect(jspFactory.getJspApplicationContext(eq(context))).andReturn(jspAppCtx);
        jspAppCtx.addELResolver(isA(FacesCompositeELResolver.class));

        control.replay();
        initializer.initFaces(context);

        // In MYFACES-1222: The Jsp21FacesInitializer isn't practicable anymore.
View Full Code Here

Examples of javax.servlet.jsp.JspApplicationContext

                logger.error("Error merging Java EE JNDI entries in to war " + standardContext.getPath() + ": Exception: " + e.getMessage(), e);
            }

            JspFactory factory = JspFactory.getDefaultFactory();
            if (factory != null) {
                JspApplicationContext applicationCtx = factory.getJspApplicationContext(standardContext.getServletContext());
                WebBeansContext context = appContext.getWebBeansContext();
                if (context != null && context.getBeanManagerImpl().isInUse()) {
                    // Registering ELResolver with JSP container
                    ELAdaptor elAdaptor = context.getService(ELAdaptor.class);
                    ELResolver resolver = elAdaptor.getOwbELResolver();
                    applicationCtx.addELResolver(resolver);
                }
            }
        }
    }
View Full Code Here

Examples of javax.servlet.jsp.JspApplicationContext

        if (context.getOpenWebBeansConfiguration().isJspApplication()) {
            logger.debug("Application is configured as JSP. Adding EL Resolver.");

            JspFactory factory = JspFactory.getDefaultFactory();
            if (factory != null) {
                JspApplicationContext applicationCtx = factory.getJspApplicationContext(servletContext);
                applicationCtx.addELResolver(resolver);
            } else {
                logger.debug("Default JspFactory instance was not found");
            }
        }
View Full Code Here

Examples of javax.servlet.jsp.JspApplicationContext

            {
                return (String) org.easymock.EasyMock.getCurrentArguments()[0];
            }
        });
       
        JspApplicationContext jspAppCtx = control.createMock(JspApplicationContext.class);
        expect(jspAppCtx.getExpressionFactory()).andReturn(expressionFactory);
        jspAppCtx.addELContextListener(isA(FacesELContextListener.class));
        expect(jspFactory.getJspApplicationContext(eq(context))).andReturn(jspAppCtx);
        jspAppCtx.addELResolver(isA(FacesCompositeELResolver.class));

        control.replay();
        initializer.initFaces(context);

        // In MYFACES-1222: The Jsp21FacesInitializer isn't practicable anymore.
View Full Code Here

Examples of javax.servlet.jsp.JspApplicationContext

     */
    private Object convertToExpectedType( final Object value,
                                          Class expectedType ) {

        JspFactory jspFactory = JspFactory.getDefaultFactory();
        JspApplicationContext jspAppContext =
            jspFactory.getJspApplicationContext(pageContext.getServletContext());
        ExpressionFactory exprFactory = jspAppContext.getExpressionFactory();
        return exprFactory.coerceToType(value, expectedType);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.