Package org.apache.beehive.netui.pageflow.interceptor.action

Examples of org.apache.beehive.netui.pageflow.interceptor.action.InterceptorForward


     * Return a URI to a nested page flow, which will be "injected" before the desired action is run.
     */
    public void preAction(ActionInterceptorContext context, InterceptorChain chain)
        throws InterceptorException {
        System.out.println("in preAction() in " + getClass().getName());
        InterceptorForward fwd = new InterceptorForward("/advanced/actioninterceptors/nested/Controller.jpf");
        setOverrideForward(fwd, context);
        chain.continueChain();
    }
View Full Code Here


            {
                Interceptors.doPreIntercept( context, interceptors );
               
                if ( context.hasInterceptorForward() )
                {
                    InterceptorForward fwd = context.getInterceptorForward();
                   
                    if ( _log.isDebugEnabled() )
                    {
                       
                        Interceptor overridingInterceptor = context.getOverridingInterceptor();
                        StringBuffer msg = new StringBuffer();
                        msg.append( "Action interceptor " );
                        msg.append( overridingInterceptor.getClass().getName() );
                        msg.append( " before action " );
                        msg.append( actionName );
                        msg.append( ": forwarding to " );
                        msg.append( fwd != null ? fwd.getPath() : "null [no forward]" );
                        _log.debug( msg.toString() );
                    }
                   
                    return fwd;
                }
            }
            else
            {
                PageFlowRequestWrapper.get( request ).setReturningFromActionIntercept( false );
            }
           
            //
            // Execute the action.
            //
            RequestInterceptorContext requestContext =
                    context != null ?
                    context :
                    new RequestInterceptorContext( request, response, getServletContext() );
            ActionRunner actionExecutor = new ActionRunner( requestContext, action, form, mapping );
            ActionForward ret = ActionInterceptors.wrapAction( context, interceptors, actionExecutor );
           
            //
            // Run any after-action interceptors.
            //
            if ( interceptors != null )
            {
                context.setOriginalForward( ret );
                Interceptors.doPostIntercept( context, interceptors );
               
                if ( context.hasInterceptorForward() )
                {
                    InterceptorForward fwd = context.getInterceptorForward();
                   
                    if ( _log.isDebugEnabled() )
                    {
                        _log.debug( "Action interceptor " + context.getOverridingInterceptor().getClass().getName()
                                    + " after action " + actionName + ": forwarding to "
                                    + fwd != null ? fwd.getPath() : "null [no forward]" );
                    }
                   
                    return fwd;
                }
            }
View Full Code Here

        ActionInterceptorContext interceptorContext = ActionInterceptorContext.getActiveContext( request, true );
       
        if ( interceptorContext != null )
        {
            ActionInterceptor interceptor = interceptorContext.getOverridingActionInterceptor();
            InterceptorForward originalForward = interceptorContext.getOriginalForward();
            String actionName = interceptorContext.getActionName();
            _stack.push( new PushedPageFlow( pageFlow, interceptor, originalForward, actionName ) );
        }
        else
        {
View Full Code Here

           
            interceptor.afterNestedIntercept( interceptorContext );
           
            if ( interceptorContext.hasInterceptorForward() )
            {
                InterceptorForward fwd = interceptorContext.getInterceptorForward();
               
                if ( _log.isDebugEnabled() )
                {
                    InternalStringBuilder message = new InternalStringBuilder();
                    message.append( "Interceptor " );
                    message.append( interceptor.getClass().getName() );
                    message.append( " after nested page flow: " );
                   
                    if ( fwd != null )
                    {
                        message.append( "forwarding to " );
                        message.append( fwd.getPath() );
                    }
                    else
                    {
                        message.append( "returned InterceptorForward is null." );
                    }
                   
                    _log.debug( message.toString() );
                }
               
                if ( fwd != null ) fwd.rehydrateRequest( request );
                return fwd;
            }
        }
        catch ( Throwable e )
        {
            //
            // Yes, we *do* mean to catch Throwable here.  It will get re-thrown if the page flow does not handle it.
            //
            _log.error( "Exception in " + interceptor.getClass().getName() + ".afterNestedIntercept", e );
           
            try
            {
                return poppedPageFlow.handleException( e, actionMapping, form, request, response );
            }
            catch ( Exception anotherException )
            {
                _log.error( "Exception thrown while handling exception.", anotherException );
            }
        }
       
        //
        // The interceptor declined to forward us anywhere -- just go to the originally-intended Forward.
        //
        InterceptorForward fwd = pushedPageFlowWrapper.getInterceptedForward();
        fwd.rehydrateRequest( request );
        return fwd;
    }
View Full Code Here

            {
                Interceptors.doPreIntercept( context, interceptors );
               
                if ( context.hasInterceptorForward() )
                {
                    InterceptorForward fwd = context.getInterceptorForward();
                   
                    if ( _log.isDebugEnabled() )
                    {
                       
                        Interceptor overridingInterceptor = context.getOverridingInterceptor();
                        StringBuffer msg = new StringBuffer();
                        msg.append( "Action interceptor " );
                        msg.append( overridingInterceptor.getClass().getName() );
                        msg.append( " before action " );
                        msg.append( actionName );
                        msg.append( ": forwarding to " );
                        msg.append( fwd != null ? fwd.getPath() : "null [no forward]" );
                        _log.debug( msg.toString() );
                    }
                   
                    return fwd;
                }
            }
            else
            {
                PageFlowRequestWrapper.get( request ).setReturningFromActionIntercept( false );
            }
           
            //
            // Execute the action.
            //
            RequestInterceptorContext requestContext =
                    context != null ?
                    context :
                    new RequestInterceptorContext( request, response, getServletContext() );
            ActionRunner actionExecutor = new ActionRunner( requestContext, action, form, mapping );
            ActionForward ret = ActionInterceptors.wrapAction( context, interceptors, actionExecutor );
           
            //
            // Run any after-action interceptors.
            //
            if ( interceptors != null )
            {
                context.setOriginalForward( ret );
                Interceptors.doPostIntercept( context, interceptors );
               
                if ( context.hasInterceptorForward() )
                {
                    InterceptorForward fwd = context.getInterceptorForward();
                   
                    if ( _log.isDebugEnabled() )
                    {
                        _log.debug( "Action interceptor " + context.getOverridingInterceptor().getClass().getName()
                                    + " after action " + actionName + ": forwarding to "
                                    + fwd != null ? fwd.getPath() : "null [no forward]" );
                    }
                   
                    return fwd;
                }
            }
View Full Code Here

           
            interceptor.afterNestedIntercept( interceptorContext );
           
            if ( interceptorContext.hasInterceptorForward() )
            {
                InterceptorForward fwd = interceptorContext.getInterceptorForward();
               
                if ( _log.isDebugEnabled() )
                {
                    InternalStringBuilder message = new InternalStringBuilder();
                    message.append( "Interceptor " );
                    message.append( interceptor.getClass().getName() );
                    message.append( " after nested page flow: " );
                   
                    if ( fwd != null )
                    {
                        message.append( "forwarding to " );
                        message.append( fwd.getPath() );
                    }
                    else
                    {
                        message.append( "returned InterceptorForward is null." );
                    }
                   
                    _log.debug( message.toString() );
                }
               
                if ( fwd != null ) fwd.rehydrateRequest( request );
                return fwd;
            }
        }
        catch ( InterceptorException e )
        {
View Full Code Here

        ActionInterceptorContext interceptorContext = ActionInterceptorContext.getActiveContext( request, true );
       
        if ( interceptorContext != null )
        {
            ActionInterceptor interceptor = interceptorContext.getOverridingActionInterceptor();
            InterceptorForward originalForward = interceptorContext.getOriginalForward();
            String actionName = interceptorContext.getActionName();
            _stack.push( new PushedPageFlow( pageFlow, interceptor, originalForward, actionName ) );
        }
        else
        {
View Full Code Here

     */
    public void preAction(ActionInterceptorContext context, InterceptorChain chain)
            throws InterceptorException
    {
        System.out.println("in preAction() in " + getClass().getName());
        InterceptorForward fwd = new InterceptorForward("/actioninterceptors/nested/Controller.jpf");
        setOverrideForward(fwd, context);
        chain.continueChain();
    }
View Full Code Here

    {
        System.out.println("in preAction() in " + getClass().getName());
        try
        {
            URI uri = new URI("/actioninterceptors/nested/Controller.jpf");
            setOverrideForward(new InterceptorForward(uri), context);
        }
        catch (URISyntaxException e)
        {
            throw new InterceptorException(e);
        }
View Full Code Here

    {
        ActionInterceptorContext interceptorContext = ActionInterceptorContext.getActiveContext( request, true );
        if ( interceptorContext != null )
        {
            ActionInterceptor interceptor = interceptorContext.getOverridingActionInterceptor();
            InterceptorForward originalForward = interceptorContext.getOriginalForward();
            String actionName = interceptorContext.getActionName();
            _stack.push( new PushedPageFlow( pageFlow, interceptor, originalForward, actionName ) );
        }
        else
        {
View Full Code Here

TOP

Related Classes of org.apache.beehive.netui.pageflow.interceptor.action.InterceptorForward

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.