Package org.apache.myfaces.context.servlet

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


        //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

        //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

        //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

        //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

        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

        //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

        //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

            throw new NullPointerException("lifecycle");
        }

        if (context instanceof ServletContext)
        {
            return new FacesContextImpl((ServletContext)context,
                                               (ServletRequest)request,
                                               (ServletResponse)response);
        }
       
        if (context instanceof PortletContext)
        {
            return new FacesContextImpl((PortletContext)context,
                                               (PortletRequest)request,
                                               (PortletResponse)response);
        }
       
        throw new FacesException("Unsupported context type " + context.getClass().getName());
View Full Code Here

        setPortletRequestFlag(request);

        try
        {
            FacesContextImpl facesContext = (FacesContextImpl)request.
                                                   getPortletSession().
                                                   getAttribute(CURRENT_FACES_CONTEXT);

            // TODO: not sure if this can happen.  Also double check this against spec section 2.1.3
            if (facesContext.getResponseComplete()) return;

            facesContext.setExternalContext(makeExternalContext(request, response));
            lifecycle.render(facesContext);
        }
        catch (Throwable e)
        {
            handleExceptionFromLifecycle(e);
View Full Code Here

TOP

Related Classes of org.apache.myfaces.context.servlet.FacesContextImpl

Copyright © 2018 www.massapicom. 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.