Examples of JspApplicationContext


Examples of javax.servlet.jsp.JspApplicationContext

    protected String getSpecificationVersion() {
        return "2.1";
    }
   
    public JspApplicationContext getJspApplicationContext(ServletContext ctx) {
        JspApplicationContext jspctx = (JspApplicationContext)ctx.getAttribute(
                JSPCTX_KEY);
        if(jspctx == null) {
            synchronized(ctx) {
                jspctx = (JspApplicationContext)ctx.getAttribute(JSPCTX_KEY);
                if(jspctx == null) {
View Full Code Here

Examples of javax.servlet.jsp.JspApplicationContext

      if (beanManager != null)
      {

         // get JspApplicationContext.
         JspApplicationContext jspAppContext = JspFactory.getDefaultFactory().getJspApplicationContext(sce.getServletContext());

         // register compositeELResolver with JSP
         jspAppContext.addELResolver(beanManager.getELResolver());

         jspAppContext.addELContextListener(Reflections.<ELContextListener>newInstance("org.jboss.weld.el.WeldELContextListener"));

         // Hack into JBoss Web/Catalina to replace the ExpressionFactory
         JspApplicationContextImpl wrappedJspApplicationContextImpl = new WeldJspApplicationContextImpl(JspApplicationContextImpl.getInstance(sce.getServletContext()), beanManager.wrapExpressionFactory(jspAppContext.getExpressionFactory()));
         sce.getServletContext().setAttribute(JspApplicationContextImpl.class.getName(), wrappedJspApplicationContextImpl);
      }
      // otherwise something went wrong starting WB, so don't register with JSP
   }
View Full Code Here

Examples of javax.servlet.jsp.JspApplicationContext

    private ELContext elContext;
   
    public ELContext getELContext() {
        if(elContext == null) {
            JspApplicationContext jspctx = JspFactory.getDefaultFactory().getJspApplicationContext(getServletContext());
            if(jspctx instanceof FreeMarkerJspApplicationContext) {
                elContext = ((FreeMarkerJspApplicationContext)jspctx).createNewELContext(this);
                elContext.putContext(JspContext.class, this);
            }
            else {
View Full Code Here

Examples of javax.servlet.jsp.JspApplicationContext

  {
    WebApp webApp = WebApp.getLocal();

    JspFactory jspFactory = JspFactory.getDefaultFactory();

    JspApplicationContext appContext
      = jspFactory.getJspApplicationContext(webApp);

    _defaultNavigationHandler = new NavigationHandlerImpl();

    _bundleManager = BundleManager.create();

    _jsfExpressionFactory = appContext.getExpressionFactory();

    ELResolver []customResolvers = new ELResolver[0];
    _elResolver = new FacesContextELResolver(customResolvers,
                                             _bundleResolver);

    setViewHandler(new JspViewHandler());

    SessionStateManager stateManager = new SessionStateManager();
   
    JsfPropertyGroup jsfPropertyGroup = webApp.getJsf();

    if (jsfPropertyGroup != null)
      stateManager.setStateSerializationMethod(
        jsfPropertyGroup.getStateSerializationMethod());

    setStateManager(stateManager);

   
    appContext.addELResolver(new FacesJspELResolver(this));

    addComponent(UIColumn.COMPONENT_TYPE,
                 "javax.faces.component.UIColumn");

    addComponent(UICommand.COMPONENT_TYPE,
View Full Code Here

Examples of javax.servlet.jsp.JspApplicationContext

        bean = new Bean();


        ExpressionFactory expressionFactory = createMock(ExpressionFactory.class);
        JspApplicationContext applicationContext = createMock(JspApplicationContext.class);
        JspFactory jspFactory = createMock(JspFactory.class);
        expect(expressionFactory.coerceToType(VALUE, String.class)).andStubReturn(VALUE);
        expect(expressionFactory.coerceToType(null, String.class)).andStubReturn(null);
        expect(applicationContext.getExpressionFactory()).andStubReturn(expressionFactory);
        expect(jspFactory.getJspApplicationContext(null)).andStubReturn(applicationContext);
        replay(jspFactory, applicationContext, expressionFactory);
        JspFactory.setDefaultFactory(jspFactory);
    }
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

        if (!installed && beanManager!= null && JspFactory.getDefaultFactory() != null) {
            synchronized (this) {
                if (!installed) {
                    installed = true;
                    // get JspApplicationContext.
                    JspApplicationContext jspAppContext = JspFactory.getDefaultFactory().getJspApplicationContext(
                            sre.getServletContext());

                    // register compositeELResolver with JSP
                    jspAppContext.addELResolver(beanManager.getELResolver());

                    jspAppContext.addELContextListener(Reflections.<ELContextListener> newInstance(
                            "org.jboss.weld.el.WeldELContextListener", getClass().getClassLoader()));

                    // Hack into JBoss Web/Catalina to replace the ExpressionFactory
                    JspApplicationContextImpl wrappedJspApplicationContextImpl = new WeldJspApplicationContextImpl(
                            JspApplicationContextImpl.getInstance(sre.getServletContext()), beanManager
                                    .wrapExpressionFactory(jspAppContext.getExpressionFactory()));
                    sre.getServletContext().setAttribute(JspApplicationContextImpl.class.getName(),
                            wrappedJspApplicationContextImpl);
                }
            }
        }
View Full Code Here

Examples of javax.servlet.jsp.JspApplicationContext

            if (associate != null) {
                associate.setFacesELResolverForJsp(compositeELResolverForJsp);
            }
                   
            // get JspApplicationContext.
            JspApplicationContext jspAppContext = JspFactory.getDefaultFactory()
                    .getJspApplicationContext(context);
   
            // cache the ExpressionFactory instance in ApplicationAssociate
            if (associate != null) {
                associate.setExpressionFactory(jspAppContext.getExpressionFactory());
            }
   
            // register compositeELResolver with JSP
            try {
                jspAppContext.addELResolver(compositeELResolverForJsp);
            }
            catch (IllegalStateException e) {
                if (!Util.isUnitTestModeEnabled() && !reloaded) {
                    throw e;
                }
            }
   
            // register JSF ELContextListenerImpl with Jsp
            ELContextListenerImpl elContextListener = new ELContextListenerImpl();
            jspAppContext.addELContextListener(elContextListener);
         }
    }
View Full Code Here

Examples of javax.servlet.jsp.JspApplicationContext

    protected String getSpecificationVersion() {
        return "2.1";
    }
   
    public JspApplicationContext getJspApplicationContext(ServletContext ctx) {
        JspApplicationContext jspctx = (JspApplicationContext)ctx.getAttribute(
                JSPCTX_KEY);
        if(jspctx == null) {
            synchronized(ctx) {
                jspctx = (JspApplicationContext)ctx.getAttribute(JSPCTX_KEY);
                if(jspctx == null) {
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.