Package org.apache.myfaces.context.servlet

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


            throw new NullPointerException("lifecycle");
        }

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


        setPortletRequestFlag(request);

        try
        {
            ServletFacesContextImpl facesContext = (ServletFacesContextImpl)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

            throw new NullPointerException("lifecycle");
        }

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

            return;
        }

        setPortletRequestFlag(request);

        ServletFacesContextImpl facesContext = null;
        try
        {
            facesContext = (ServletFacesContextImpl)request.
                                                    getPortletSession().
                                                    getAttribute(CURRENT_FACES_CONTEXT);
           
            if (facesContext == null) // processAction was not called
            {
               facesContext = (ServletFacesContextImpl)facesContext(request, response);
               setViewRootOnFacesContext(facesContext, viewId);
            }
           
            // 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));
            restoreRequestAttributes(request);
            lifecycle.render(facesContext);
        }
        catch (Throwable e)
        {
View Full Code Here

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

      
        setPortletRequestFlag(request);
       
        try
        {
            ServletFacesContextImpl facesContext = (ServletFacesContextImpl)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

            throw new NullPointerException("lifecycle");
        }

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

        setPortletRequestFlag(request);

        try
        {
            ServletFacesContextImpl facesContext = (ServletFacesContextImpl)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

            request.getPortletSession().removeAttribute(VIEW_ID);
            request.getPortletSession().setAttribute
                (PREV_MODE, request.getPortletMode().toString());
        }
       
        ServletFacesContextImpl facesContext = (ServletFacesContextImpl) request
            .getPortletSession().getAttribute(CURRENT_FACES_CONTEXT);
        String viewId = (String) request.getPortletSession().getAttribute(VIEW_ID);
        if (facesContext == null || viewId == null || sessionTimedOut(request)) {
            setPortletRequestFlag(request);
            nonFacesRequest(request,  response);
            return;
        }

        setPortletRequestFlag(request);

        try {
            // 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));
            renderProtected(request, response, facesContext, true);
        } catch (Throwable e) {
            handleExceptionFromLifecycle(e);
        }
View Full Code Here

            if (lifecycleId == null) {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
                return;
            }
            Lifecycle lifecycle = lifecycleFactory.getLifecycle(lifecycleId);
            ServletFacesContextImpl facesContext = (ServletFacesContextImpl)
            facesContextFactory.getFacesContext
            (getServletContext(), request, response, lifecycle);
            facesContext.setExternalContext(externalContext);
            lifecycle.execute(facesContext);
            facesContext.getApplication()
            .getStateManager().saveSerializedView(facesContext);
        } finally {
            scope.leave();
        }
    }
View Full Code Here

TOP

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

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.