Examples of ApplicationFactory


Examples of javax.faces.application.ApplicationFactory

  }

  public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
    // Maybe this is an Ajax request and the application is not *yet* initialized
    // In this case, it is not a ApplicationEx
    ApplicationFactory f = (ApplicationFactoryEx )FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
    if(!(f.getApplication() instanceof ApplicationEx)) {
      emitError(servletResponse);
      return;
    }
   
    // Make sure that the JSF servlet is created and initialized
View Full Code Here

Examples of javax.faces.application.ApplicationFactory

   private Application getApplication()
   {
      try
      {
         ApplicationFactory factory = (ApplicationFactory) FactoryFinder
            .getFactory(FactoryFinder.APPLICATION_FACTORY);
         return factory.getApplication();
      }
      catch (IllegalStateException e)
      {
         // just in case, for units and the like
         // if we can't do it, it just wan't meant to be
View Full Code Here

Examples of javax.faces.application.ApplicationFactory

              // IN JSF-RI verifications, context may be null !
              if(null != context) {
        defaultRenderkitId = context.getApplication()
            .getDefaultRenderKitId();
              } else {
                  ApplicationFactory appFactory =(ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
                  defaultRenderkitId = appFactory.getApplication().getDefaultRenderKitId();
        }
      } catch (Exception e) {
        // TODO: handle exception
      }
            if(defaultRenderkitId == null ){
View Full Code Here

Examples of javax.faces.application.ApplicationFactory

    // IN JSF-RI verifications, context may be null !
    if (null != context) {
        baseRenderKitId = context.getApplication()
          .getDefaultRenderKitId();
    } else {
        ApplicationFactory appFactory = (ApplicationFactory) FactoryFinder
          .getFactory(FactoryFinder.APPLICATION_FACTORY);
        baseRenderKitId = appFactory.getApplication()
          .getDefaultRenderKitId();
    }
      } catch (Exception e) {
    _log.warn(Messages
      .getMessage(Messages.GET_DEFAULT_RENDER_KIT_ERROR), e);
View Full Code Here

Examples of javax.faces.application.ApplicationFactory

    if (loadedPropertiesCount == 0) {
      throw new SkinNotFoundException(Messages.getMessage(
          Messages.SKIN_NOT_FOUND_ERROR, name));
    }
    // replace all EL-expressions by prepared ValueBinding ?
    ApplicationFactory factory = (ApplicationFactory) FactoryFinder
        .getFactory(FactoryFinder.APPLICATION_FACTORY);
    Application app = factory.getApplication();
    Map skinParams = new HashMap();
    for (Enumeration e = skinProperties.propertyNames(); e
        .hasMoreElements();) {
      String propertyName = (String) e.nextElement();
      String property = skinProperties.getProperty(propertyName);
View Full Code Here

Examples of javax.faces.application.ApplicationFactory

        externalContext = (MockExternalContext) facesContext.getExternalContext();
        UIViewRoot root = new UIViewRoot();
        root.setViewId("/viewId");
        root.setRenderKitId(RenderKitFactory.HTML_BASIC_RENDER_KIT);
        facesContext.setViewRoot(root);
        ApplicationFactory applicationFactory = (ApplicationFactory)
                FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
        application = (MockApplication) applicationFactory.getApplication();
        facesContext.setApplication(application);
        RenderKitFactory renderKitFactory = (RenderKitFactory)
                FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
        renderKit = new MockRenderKit();
        renderKitFactory.addRenderKit(RenderKitFactory.HTML_BASIC_RENDER_KIT, renderKit);
View Full Code Here

Examples of javax.faces.application.ApplicationFactory

        ExternalContext externalContext = getContext().getExternalContext();

        // test decorator pattern support

        // application factory
        ApplicationFactory applicationFactory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
        assertEquals(TestApplicationFactory.class, applicationFactory.getClass());

        javax.faces.application.Application application = applicationFactory.getApplication();

        assertEquals("messageBundleA", application.getMessageBundle());

        LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
        assertEquals(TestLifecycleFactory.class, lifecycleFactory.getClass());
View Full Code Here

Examples of javax.faces.application.ApplicationFactory

   
    // JSF Spec section 2.1.1
    protected void nonFacesRequest(RenderRequest request, RenderResponse response) throws PortletException
    {
        if (log.isTraceEnabled()) log.trace("Non-faces request: contextPath = " + request.getContextPath());
        ApplicationFactory appFactory =
            (ApplicationFactory)FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
        Application application = appFactory.getApplication();
        ViewHandler viewHandler = application.getViewHandler();
        FacesContext facesContext = facesContext(request, response);
        UIViewRoot view = viewHandler.createView(facesContext, selectDefaultView(request, response));
        facesContext.setViewRoot(view);
        lifecycle.render(facesContext);
View Full Code Here

Examples of javax.faces.application.ApplicationFactory

        {
            return context.getApplication();
        }
        else
        {
            ApplicationFactory afactory = (ApplicationFactory)FactoryFinder.getFactory(
                    "javax.faces.application.ApplicationFactory");
            return afactory.getApplication();
        }
    }
View Full Code Here

Examples of javax.faces.application.ApplicationFactory

    protected ExpressionFactory getExpressionFactory()
    {
        if (expressionFactory == null)
        {
            ApplicationFactory appFactory = (ApplicationFactory) FactoryFinder
                .getFactory(FactoryFinder.APPLICATION_FACTORY);
            expressionFactory = appFactory.getApplication().getExpressionFactory();
        }
        return expressionFactory;
    }
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.