Examples of FacesContextImpl


Examples of com.sun.faces.context.FacesContextImpl

        ExternalContext extContext = new ExternalContextImpl(
            config.getServletContext(),
            testRequest,
            response);
        FacesContext facesContext = new FacesContextImpl(extContext, lifecycle);
        String contextPath = request.getContextPath();

        ViewHandlerImpl handler = new ViewHandlerImpl();

        // if getServletPath() returns "" then the viewId path returned should
View Full Code Here

Examples of com.sun.faces.context.FacesContextImpl

            factory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
        ExternalContext extContext =
            new ExternalContextImpl(config.getServletContext(),
                                    request, response);
        FacesContext context =
            new FacesContextImpl(extContext, lifecycle);

        // Validate correct calculations
        assertEquals(request.getContextPath() + "/index.jsp",
                     Util.getViewHandler(getFacesContext()).
                     getResourceURL(context, "/index.jsp"));
View Full Code Here

Examples of org.apache.myfaces.context.servlet.FacesContextImpl

            }
        }
       
        if (context instanceof ServletContext)
        {
            FacesContext facesContext = new FacesContextImpl(externalContext, null, this);
           
            facesContext.setExceptionHandler(_exceptionHandlerFactory.getExceptionHandler());
           
            return facesContext;
            //return new FacesContextImpl((ServletContext)context, (ServletRequest)request, (ServletResponse)response);
        }
View Full Code Here

Examples of org.apache.myfaces.context.servlet.FacesContextImpl

        //if (context instanceof ServletContext)
        //{
            FacesContext facesContext;
            if (externalContext instanceof ReleaseableExternalContext)
            {
                facesContext = new FacesContextImpl(externalContext, (ReleaseableExternalContext) externalContext,
                                                    this);
            }
            else if (defaultExternalContext != null && defaultExternalContext instanceof ReleaseableExternalContext)
            {
                facesContext = new FacesContextImpl(externalContext,
                                                    (ReleaseableExternalContext) defaultExternalContext, this);
            }
            else
            {
                facesContext = new FacesContextImpl(externalContext, null, this);
            }
           
            facesContext.setExceptionHandler(_exceptionHandlerFactory.getExceptionHandler());
           
            return facesContext;
View Full Code Here

Examples of org.apache.myfaces.context.servlet.FacesContextImpl

        //if (context instanceof ServletContext)
        //{
            FacesContext facesContext;
            if (externalContext instanceof ReleaseableExternalContext)
            {
                facesContext = new FacesContextImpl(externalContext, (ReleaseableExternalContext) externalContext, this);
            }
            else if (defaultExternalContext != null && defaultExternalContext instanceof ReleaseableExternalContext)
            {
                facesContext = new FacesContextImpl(externalContext, (ReleaseableExternalContext) defaultExternalContext, this);
            }
            else
            {
                facesContext = new FacesContextImpl(externalContext, null, this);
            }
           
            facesContext.setExceptionHandler(_exceptionHandlerFactory.getExceptionHandler());
           
            return facesContext;
View Full Code Here

Examples of org.apache.myfaces.context.servlet.FacesContextImpl

        //if (context instanceof ServletContext)
        //{
            FacesContext facesContext;
            if (externalContext instanceof ReleaseableExternalContext)
            {
                facesContext = new FacesContextImpl(externalContext, (ReleaseableExternalContext) externalContext,
                                                    this, _applicationFactory, _renderKitFactory,
                                                    _partialViewContextFactory);
            }
            else if (defaultExternalContext != null && defaultExternalContext instanceof ReleaseableExternalContext)
            {
                facesContext = new FacesContextImpl(externalContext,
                                                    (ReleaseableExternalContext) defaultExternalContext, this,
                                                    _applicationFactory, _renderKitFactory,
                                                    _partialViewContextFactory);
            }
            else
            {
                facesContext = new FacesContextImpl(externalContext, null, this,
                                                    _applicationFactory, _renderKitFactory,
                                                    _partialViewContextFactory);
            }
           
            facesContext.setExceptionHandler(_exceptionHandlerFactory.getExceptionHandler());
View Full Code Here

Examples of org.apache.myfaces.context.servlet.FacesContextImpl

        //ContextTestRequestWrapper wrapper = new ContextTestRequestWrapper(request, requestParameterMap);
        FactoryFinder.setFactory(FactoryFinder.PARTIAL_VIEW_CONTEXT_FACTORY,
            "org.apache.myfaces.context.PartialViewContextFactoryImpl");    
        FactoryFinder.setFactory (FactoryFinder.EXCEPTION_HANDLER_FACTORY,
        "org.apache.myfaces.context.ExceptionHandlerFactoryImpl");
        context = new FacesContextImpl(servletContext, request, response);
    }
View Full Code Here

Examples of org.apache.myfaces.context.servlet.FacesContextImpl

        ByteArrayOutputStream ostrWriter = new ByteArrayOutputStream();
        PrintWriter writer = new PrintWriter(ostrWriter);
        ServletOutputStreamMock sOstr = new ServletOutputStreamMock(ostr);
        NewStreamingMockResponse resp = new NewStreamingMockResponse(response, sOstr, writer);

        FacesContext context = new FacesContextImpl(servletContext, request, resp);


        ResponseWriter responseWriter = context.getResponseWriter();
        if (responseWriter == null) {
            try {
                responseWriter = new MockResponseWriter(((ServletResponse) context.getExternalContext().getResponse()).getWriter(), null, null);
            } catch (IOException ex) {
                super.fail(ex.getMessage());
            }
            context.setResponseWriter(responseWriter);
        }



        assertTrue("responsewriter not null", responseWriter != null);
View Full Code Here

Examples of org.apache.myfaces.context.servlet.FacesContextImpl

        //if (context instanceof ServletContext)
        //{
            FacesContext facesContext;
            if (externalContext instanceof ReleaseableExternalContext)
            {
                facesContext = new FacesContextImpl(externalContext, (ReleaseableExternalContext) externalContext, this);
            }
            else if (defaultExternalContext != null && defaultExternalContext instanceof ReleaseableExternalContext)
            {
                facesContext = new FacesContextImpl(externalContext, (ReleaseableExternalContext) defaultExternalContext, this);
            }
            else
            {
                facesContext = new FacesContextImpl(externalContext, null, this);
            }
           
            facesContext.setExceptionHandler(_exceptionHandlerFactory.getExceptionHandler());
           
            return facesContext;
View Full Code Here

Examples of org.apache.myfaces.context.servlet.FacesContextImpl

        //if (context instanceof ServletContext)
        //{
            FacesContext facesContext;
            if (externalContext instanceof ReleaseableExternalContext)
            {
                facesContext = new FacesContextImpl(externalContext, (ReleaseableExternalContext) externalContext, this);
            }
            else if (defaultExternalContext != null && defaultExternalContext instanceof ReleaseableExternalContext)
            {
                facesContext = new FacesContextImpl(externalContext, (ReleaseableExternalContext) defaultExternalContext, this);
            }
            else
            {
                facesContext = new FacesContextImpl(externalContext, null, this);
            }
           
            facesContext.setExceptionHandler(_exceptionHandlerFactory.getExceptionHandler());
           
            return facesContext;
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.