Package org.apache.beehive.netui.pageflow

Examples of org.apache.beehive.netui.pageflow.FacesBackingBean


                                                                  ServletContext servletContext )
    {
        String uri = InternalUtils.getDecodedServletPath( request );
        assert uri.charAt( 0 ) == '/' : uri;
        String backingClassName = FileUtils.stripFileExtension( uri.substring( 1 ).replace( '/', '.' ) );
        FacesBackingBean currentBean = InternalUtils.getFacesBackingBean( request );
       
        //
        // If there is no current backing bean, or if the current one doesn't match the desired classname, create one.
        //
        if ( currentBean == null || ! currentBean.getClass().getName().equals( backingClassName ) )
        {
            FacesBackingBean bean = null;
           
            if ( FileUtils.uriEndsWith( uri, FACES_EXTENSION ) || FileUtils.uriEndsWith( uri, JSF_EXTENSION ) )
            {
                bean = loadFacesBackingBean( request, servletContext, backingClassName );
               
                //
                // If we didn't create (or failed to create) a backing bean, and if this is a JSF request, then create
                // a default one.  This ensures that there will be a place for things like page inputs, that get stored
                // in the backing bean across postbacks to the same JSF.
                //
                if ( bean == null ) bean = new DefaultFacesBackingBean();
               
                //
                // If we created a backing bean, invoke its create callback, and tell it to store itself in the session.
                //
                if ( bean != null )
                {
                    try
                    {
                        bean.create( request, response, servletContext );
                    }
                    catch ( Exception e )
                    {
                        _log.error( "Error while creating backing bean instance of " + backingClassName, e );
                    }
                   
                    bean.persistInSession( request, response );
                    return bean;
                }
            }
           
            //
View Full Code Here


    }

    public static final void loadImplicitObjects(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext, PageFlowController curJpf) {
        // @todo: need to wrap this in checks for JSP 1.2
        // @todo: feature: need to add support for chaining in user-code to run when setting implicit objects on the request
        FacesBackingBean fbb =
            FacesBackingBeanFactory.getFacesBackingBeanForRequest(request, response, servletContext);
        loadPageFlow(request, curJpf, fbb);
       
        // @todo: need to move bundleMap creation to a BundleMapFactory
        BundleMap bundleMap = new BundleMap(request, servletContext);
View Full Code Here

                viewID = FileUtils.stripFileExtension( viewID );
                String currentForwardPath = FileUtils.stripFileExtension( curPageFlow.getCurrentForwardPath() );
                if ( viewID.equals( currentForwardPath ) )
                {
                    PreviousPageInfo prevPageInfo = curPageFlow.getCurrentPageInfo();
                    FacesBackingBean backingBean = InternalUtils.getFacesBackingBean( request );
                    prevPageInfo.setClientState( new PageClientState( viewRoot, backingBean ) );
                }
            }
        }
    }
View Full Code Here

    private static void setBackingBean( ServletRequest request, ServletResponse response, ServletContext servletContext )
    {
        if ( request instanceof HttpServletRequest )
        {
            FacesBackingBeanFactory factory = FacesBackingBeanFactory.get( servletContext );
            FacesBackingBean fbb = factory.getFacesBackingBeanForRequest( new RequestContext( request, response ) );
           
            if ( fbb != null )
            {
                ImplicitObjectUtil.loadFacesBackingBean( request, fbb );
            }
View Full Code Here

                    Object clientState = prevPageInfo.getClientState();
                   
                    if ( clientState != null && clientState instanceof PageClientState )
                    {
                        PageClientState pcs = ( PageClientState ) clientState;
                        FacesBackingBean fbb = pcs.getBackingBean();
                        ServletContext servletContext = ( ServletContext ) externalContext.getContext();
                       
                        if ( fbb != null )
                        {
                            HttpServletResponse httpResponse = ( HttpServletResponse ) externalContext.getResponse();
                            fbb.restore( httpRequest, httpResponse, servletContext );
                        }
                        else
                        {
                            InternalUtils.removeCurrentFacesBackingBean( httpRequest, servletContext );
                        }
View Full Code Here

                viewID = FileUtils.stripFileExtension( viewID );
                String currentForwardPath = FileUtils.stripFileExtension( curPageFlow.getCurrentForwardPath() );
                if ( viewID.equals( currentForwardPath ) )
                {
                    PreviousPageInfo prevPageInfo = curPageFlow.getCurrentPageInfo();
                    FacesBackingBean backingBean = InternalUtils.getFacesBackingBean( request, servletContext );
                    prevPageInfo.setClientState( new PageClientState( viewRoot, backingBean ) );
                }
            }
        }
    }
View Full Code Here

    private static void setBackingBean( ServletRequest request, ServletResponse response, ServletContext servletContext )
    {
        if ( request instanceof HttpServletRequest )
        {
            FacesBackingBeanFactory factory = FacesBackingBeanFactory.get( servletContext );
            FacesBackingBean fbb = factory.getFacesBackingBeanForRequest( new RequestContext( request, response ) );
           
            if ( fbb != null )
            {
                ImplicitObjectUtil.loadFacesBackingBean( request, fbb );
            }
View Full Code Here

                    Object clientState = prevPageInfo.getClientState();
                   
                    if ( clientState != null && clientState instanceof PageClientState )
                    {
                        PageClientState pcs = ( PageClientState ) clientState;
                        FacesBackingBean fbb = pcs.getBackingBean();
                        ServletContext servletContext = ( ServletContext ) externalContext.getContext();
                       
                        if ( fbb != null )
                        {
                            HttpServletResponse httpResponse = ( HttpServletResponse ) externalContext.getResponse();
                            fbb.restore( httpRequest, httpResponse, servletContext );
                        }
                        else
                        {
                            InternalUtils.removeCurrentFacesBackingBean( httpRequest, servletContext );
                        }
View Full Code Here

                viewID = FileUtils.stripFileExtension( viewID );
                String currentForwardPath = FileUtils.stripFileExtension( curPageFlow.getCurrentForwardPath() );
                if ( viewID.equals( currentForwardPath ) )
                {
                    PreviousPageInfo prevPageInfo = curPageFlow.theCurrentPageInfo();
                    FacesBackingBean backingBean = InternalUtils.getFacesBackingBean( request, servletContext );
                    prevPageInfo.setClientState( new PageClientState( viewRoot, backingBean ) );
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.beehive.netui.pageflow.FacesBackingBean

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.