Package org.apache.beehive.netui.pageflow.handler

Examples of org.apache.beehive.netui.pageflow.handler.ForwardRedirectHandler


        {
            InternalStringBuilder sfActionURI = new InternalStringBuilder( sharedFlowToTry.getModulePath() );
            sfActionURI.append( '/' );
            sfActionURI.append( uriBaseName );
            rw.setOriginalServletPath( uri );
            ForwardRedirectHandler frh = _handlers.getForwardRedirectHandler();
            FlowControllerHandlerContext context = new FlowControllerHandlerContext( request, response, null );
            frh.forward( context, sfActionURI.toString() );
            return true;
        }
       
        return false;
    }
View Full Code Here


     */
    protected void processForwardConfig( HttpServletRequest request, HttpServletResponse response, ForwardConfig fwd )
            throws IOException, ServletException
    {
        ServletContext servletContext = getServletContext();
        ForwardRedirectHandler fwdRedirectHandler = _handlers.getForwardRedirectHandler();
        FlowController fc = PageFlowRequestWrapper.get( request ).getCurrentFlowController();
        FlowControllerHandlerContext context = new FlowControllerHandlerContext( request, response, fc );

        // Register this module as the one that's handling the action.
        if ( fc != null )
        {
            InternalUtils.setForwardingModule( request, fc.getModulePath() );
        }

        //
        // The following is similar to what's in super.processForwardConfig(), but it avoids putting
        // a slash in front of absolute URLs (e.g., ones that start with "http:").
        //
        if ( fwd != null )
        {
            if ( _log.isDebugEnabled() ) _log.debug( "processForwardConfig(" + fwd + ')' );

            //
            // Try to process a tiles definition. If the forward doesn't contain a
            // a tiles definition, continue on.
            //
            if ( processTilesDefinition( fwd.getPath(), fwd.getContextRelative(), request, response ) )
            {
                if ( log.isDebugEnabled() )
                {
                    log.debug( "  '" + fwd.getPath() + "' - processed as definition" );
                }
                return;
            }

            //
            // If this is a "special" page flow forward, create a Forward to handle it and pass
            // it to the current page flow.  This should only happen when processValidate()
            // calls this method (or if a plain Struts action forwards to this forward) --
            // otherwise, the page flow should be using a Forward already.
            //
            if ( fwd instanceof PageFlowActionForward )
            {
                ActionMapping mapping = ( ActionMapping ) request.getAttribute( Globals.MAPPING_KEY );
                assert mapping != null;
                ActionForm form = InternalUtils.getFormBean( mapping, request );
                Forward pfFwd = new Forward( ( ActionForward ) fwd, servletContext );
                ActionForwardHandler handler = _handlers.getActionForwardHandler();
                fwd = handler.doForward( context, pfFwd, mapping, InternalUtils.getActionName( mapping ), null, form );
            }

            String path = fwd.getPath();
            boolean startsWithSlash = path.length() > 0 && path.charAt( 0 ) == '/';

            //
            // If the URI is absolute (e.g., starts with "http:"), do a redirect to it no matter what.
            //
            if ( FileUtils.isAbsoluteURI( path ) )
            {
                fwdRedirectHandler.redirect( context, addScopeParams( path, request ) );
            }
            else if ( fwd.getRedirect() )
            {
                String redirectURI;

                if ( startsWithSlash && fwd instanceof Forward && ( ( Forward ) fwd ).isExplicitPath() )
                {
                    redirectURI = path;
                }
                else if ( fwd instanceof Forward && ( ( Forward ) fwd ).isExternalRedirect() )
                {
                    assert startsWithSlash : path; // compiler should ensure path starts with '/'
                    redirectURI = path;
                }
                else
                {
                    redirectURI = request.getContextPath() + RequestUtils.forwardURL( request, fwd );
                }

                fwdRedirectHandler.redirect( context, addScopeParams( redirectURI, request ) );
            }
            else
            {
                String fwdURI;

View Full Code Here

        //
        URI redirectURI = new URI( scheme, null, request.getServerName(), port,
                                   request.getContextPath() + webappRelativeURI,
                                   queryString, null );

        ForwardRedirectHandler fwdRedirectHandler = _handlers.getForwardRedirectHandler();
        fwdRedirectHandler.redirect( context, redirectURI.toString() );

        if ( _log.isDebugEnabled() )
        {
            _log.debug( "Redirected to " + redirectURI );
        }
View Full Code Here

        if ( ! securityRedirected )
        {
            if ( ! processPageForward( uri, request, response ) )
            {
                ForwardRedirectHandler fwdRedirectHandler = _handlers.getForwardRedirectHandler();
                fwdRedirectHandler.forward( context, uri );
            }
        }
    }
View Full Code Here

     */
    protected void processForwardConfig( HttpServletRequest request, HttpServletResponse response, ForwardConfig fwd )
            throws IOException, ServletException
    {
        ServletContext servletContext = getServletContext();
        ForwardRedirectHandler fwdRedirectHandler = _handlers.getForwardRedirectHandler();
        FlowController fc = PageFlowRequestWrapper.get( request ).getCurrentFlowController();
        FlowControllerHandlerContext context = new FlowControllerHandlerContext( request, response, fc );

        // Register this module as the one that's handling the action.
        if ( fc != null )
        {
            InternalUtils.setForwardingModule( request, fc.getModulePath() );
        }
       
        //
        // The following is similar to what's in super.processForwardConfig(), but it avoids putting
        // a slash in front of absolute URLs (e.g., ones that start with "http:").
        //
        if ( fwd != null )
        {
            if ( _log.isDebugEnabled() ) _log.debug( "processForwardConfig(" + fwd + ')' );
   
            //
            // Try to process a tiles definition. If the forward doesn't contain a
            // a tiles definition, continue on.
            //
            if ( processTilesDefinition( fwd.getPath(), fwd.getContextRelative(), request, response ) )
            {
                if ( log.isDebugEnabled() )
                {
                    log.debug( "  '" + fwd.getPath() + "' - processed as definition" );
                }
                return;
            }

            //
            // If this is a "special" page flow forward, create a Forward to handle it and pass
            // it to the current page flow.  This should only happen when processValidate()
            // calls this method (or if a plain Struts action forwards to this forward) --
            // otherwise, the page flow should be using a Forward already.
            //
            if ( fwd instanceof PageFlowActionForward )
            {
                ActionMapping mapping = ( ActionMapping ) request.getAttribute( Globals.MAPPING_KEY );
                assert mapping != null;
                ActionForm form = InternalUtils.getFormBean( mapping, request );
                Forward pfFwd = new Forward( ( ActionForward ) fwd, servletContext );
                ActionForwardHandler handler = _handlers.getActionForwardHandler();
                fwd = handler.doForward( context, pfFwd, mapping, InternalUtils.getActionName( mapping ), null, form );
            }
           
            String path = fwd.getPath();
            boolean startsWithSlash = path.length() > 0 && path.charAt( 0 ) == '/';
           
            //
            // If the URI is absolute (e.g., starts with "http:"), do a redirect to it no matter what.
            //
            if ( FileUtils.isAbsoluteURI( path ) )
            {
                fwdRedirectHandler.redirect( context, addScopeParams( path, request ) );
            }
            else if ( fwd.getRedirect() )
            {
                String redirectURI;
               
                if ( startsWithSlash && fwd instanceof Forward && ( ( Forward ) fwd ).isExplicitPath() )
                {
                    redirectURI = path;
                }
                else if ( fwd instanceof Forward && ( ( Forward ) fwd ).isExternalRedirect() )
                {
                    assert startsWithSlash : path; // compiler should ensure path starts with '/'
                    redirectURI = path;
                }
                else
                {
                    redirectURI = request.getContextPath() + RequestUtils.forwardURL( request, fwd );
                }
               
                fwdRedirectHandler.redirect( context, addScopeParams( redirectURI, request ) );
            }
            else
            {
                String fwdURI;
               
View Full Code Here

        //
        URI redirectURI = new URI( scheme, null, request.getServerName(), port,
                                   request.getContextPath() + webappRelativeURI,
                                   queryString, null );
       
        ForwardRedirectHandler fwdRedirectHandler = _handlers.getForwardRedirectHandler();
        fwdRedirectHandler.redirect( context, redirectURI.toString() );
       
        if ( _log.isDebugEnabled() )
        {
            _log.debug( "Redirected to " + redirectURI );
        }
View Full Code Here

       
        if ( ! securityRedirected )
        {
            if ( ! processPageForward( uri, request, response ) )
            {
                ForwardRedirectHandler fwdRedirectHandler = _handlers.getForwardRedirectHandler();
                fwdRedirectHandler.forward( context, uri );
            }
        }
    }
View Full Code Here

        {
            InternalStringBuilder sfActionURI = new InternalStringBuilder( sharedFlowToTry.getModulePath() );
            sfActionURI.append( '/' );
            sfActionURI.append( uriBaseName );
            rw.setOriginalServletPath( uri );
            ForwardRedirectHandler frh = _handlers.getForwardRedirectHandler();
            FlowControllerHandlerContext context = new FlowControllerHandlerContext( request, response, null );
            frh.forward( context, sfActionURI.toString() );
            return true;
        }
       
        return false;
    }
View Full Code Here

        {
            InternalStringBuilder sfActionURI = new InternalStringBuilder( sharedFlowToTry.getModulePath() );
            sfActionURI.append( '/' );
            sfActionURI.append( uriBaseName );
            rw.setOriginalServletPath( uri );
            ForwardRedirectHandler frh = _handlers.getForwardRedirectHandler();
            FlowControllerHandlerContext context = new FlowControllerHandlerContext( request, response, null );
            frh.forward( context, sfActionURI.toString() );
            return true;
        }
       
        return false;
    }
View Full Code Here

     */
    protected void processForwardConfig( HttpServletRequest request, HttpServletResponse response, ForwardConfig fwd )
            throws IOException, ServletException
    {
        ServletContext servletContext = getServletContext();
        ForwardRedirectHandler fwdRedirectHandler = _handlers.getForwardRedirectHandler();
        FlowController fc = PageFlowRequestWrapper.get( request ).getCurrentFlowController();
        FlowControllerHandlerContext context = new FlowControllerHandlerContext( request, response, fc );

        // Register this module as the one that's handling the action.
        if ( fc != null )
        {
            InternalUtils.setForwardingModule( request, fc.getModulePath() );
        }

        //
        // The following is similar to what's in super.processForwardConfig(), but it avoids putting
        // a slash in front of absolute URLs (e.g., ones that start with "http:").
        //
        if ( fwd != null )
        {
            if ( _log.isDebugEnabled() ) _log.debug( "processForwardConfig(" + fwd + ')' );

            //
            // Try to process a tiles definition. If the forward doesn't contain a
            // a tiles definition, continue on.
            //
            if ( processTilesDefinition( fwd.getPath(), fwd.getContextRelative(), request, response ) )
            {
                if ( log.isDebugEnabled() )
                {
                    log.debug( "  '" + fwd.getPath() + "' - processed as definition" );
                }
                return;
            }

            //
            // If this is a "special" page flow forward, create a Forward to handle it and pass
            // it to the current page flow.  This should only happen when processValidate()
            // calls this method (or if a plain Struts action forwards to this forward) --
            // otherwise, the page flow should be using a Forward already.
            //
            if ( fwd instanceof PageFlowActionForward )
            {
                ActionMapping mapping = ( ActionMapping ) request.getAttribute( Globals.MAPPING_KEY );
                assert mapping != null;
                ActionForm form = InternalUtils.getFormBean( mapping, request );
                Forward pfFwd = new Forward( ( ActionForward ) fwd, servletContext );
                ActionForwardHandler handler = _handlers.getActionForwardHandler();
                fwd = handler.processForward( context, pfFwd, mapping, null, InternalUtils.getActionName( mapping ),
                                              null, form );
            }

            String path = fwd.getPath();
            boolean startsWithSlash = path.length() > 0 && path.charAt( 0 ) == '/';

            //
            // If the URI is absolute (e.g., starts with "http:"), do a redirect to it no matter what.
            //
            if ( FileUtils.isAbsoluteURI( path ) )
            {
                fwdRedirectHandler.redirect( context, addScopeParams( path, request ) );
            }
            else if ( fwd.getRedirect() )
            {
                String redirectURI;

                if ( startsWithSlash && fwd instanceof Forward && ( ( Forward ) fwd ).isExplicitPath() )
                {
                    redirectURI = path;
                }
                else if ( fwd instanceof Forward && ( ( Forward ) fwd ).isExternalRedirect() )
                {
                    assert startsWithSlash : path; // compiler should ensure path starts with '/'
                    redirectURI = path;
                }
                else
                {
                    redirectURI = request.getContextPath() + RequestUtils.forwardURL( request, fwd );
                }

                fwdRedirectHandler.redirect( context, addScopeParams( redirectURI, request ) );
            }
            else
            {
                String fwdURI;

View Full Code Here

TOP

Related Classes of org.apache.beehive.netui.pageflow.handler.ForwardRedirectHandler

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.