Examples of InternalStringBuilder


Examples of org.apache.beehive.netui.util.internal.InternalStringBuilder

    {
        ModuleConfig appConfig = ( ModuleConfig ) request.getAttribute( Globals.MODULE_KEY );

        if ( appConfig != null )
        {
            InternalStringBuilder value = new InternalStringBuilder( qualifiedAction.length() + 16 );
            value.append( appConfig.getPrefix() );
            value.append( qualifiedAction );
            return value.toString();
        }

        return qualifiedAction;
    }
View Full Code Here

Examples of org.apache.beehive.netui.util.internal.InternalStringBuilder

                    modulePath = PageFlowUtils.getModulePathForRelativeURI( originalServletPath );
                }
               
                if ( _log.isErrorEnabled() )
                {
                    InternalStringBuilder msg = new InternalStringBuilder( "No module configuration registered for " );
                    msg.append( servletPath ).append( " (module path " ).append( modulePath ).append( ")." );
                    _log.error( msg.toString() );
                }

                //
                // If we're not in production mode, send a diagnostic on the response; otherwise, simply send a 404.
                //
View Full Code Here

Examples of org.apache.beehive.netui.util.internal.InternalStringBuilder

    }

    public static String qualifyAction( ServletContext servletContext, String action )
    {
        assert action != null;
        InternalStringBuilder sb = null;

        String queryString = null;
        int question = action.indexOf( '?' );
        if ( question >= 0 ) queryString = action.substring( question );

        String actionMapping = getActionMappingName( action );
        sb = new InternalStringBuilder( action.length() + ACTION_EXTENSION_LEN + 1 );
        sb.append( actionMapping );
        sb.append( ACTION_EXTENSION );
        if ( queryString != null ) sb.append( queryString );

        return sb.toString();
    }
View Full Code Here

Examples of org.apache.beehive.netui.util.internal.InternalStringBuilder

   
    private String getStrutsLocalURI()
    {
        String className = getClass().getName();
        int lastDot = className.lastIndexOf( '.' );
        InternalStringBuilder ret = new InternalStringBuilder( "/" );
        return ret.append( className.substring( lastDot + 1 ) ).append( JPF_EXTENSION ).toString();
    }
View Full Code Here

Examples of org.apache.beehive.netui.util.internal.InternalStringBuilder

                           + curJpf.getClass().getName() );
            }
                   
            if ( _log.isWarnEnabled() )
            {
                InternalStringBuilder msg = new InternalStringBuilder( "Tried to pop from empty PageFlow stack." );
                msg.append( "  Current page flow is " );
                msg.append( curJpf != null ? curJpf.getClass().getName() : null );
                _log.warn( msg.append( '.' ).toString() );
            }
                   
            PageFlowException ex = new EmptyNestingStackException( returnAction, curJpf );
            InternalUtils.throwPageFlowException( ex, request );
        }
               
        // Only nested PageFlowControllers can have return actions.
        assert context.getFlowController() instanceof PageFlowController
                : context.getFlowController().getClass().getName() + " is not a " + PageFlowController.class.getName();
        ActionForward exceptionFwd =
                ( ( PageFlowController ) context.getFlowController() ).exitNesting( request, response, mapping, form );
        if ( exceptionFwd != null ) return exceptionFwd;
               
        PageFlowStack.PushedPageFlow pushedPageFlowWrapper = pfStack.pop( request );
        PageFlowController poppedPageFlow = pushedPageFlowWrapper.getPageFlow();

        if ( _log.isDebugEnabled() )
        {
            _log.debug( "Popped PageFlowController " + poppedPageFlow + " from the nesting stack" );
        }

        InternalUtils.setCurrentPageFlow( poppedPageFlow, request, getServletContext() );

               
        //
        // If an ActionInterceptor forwarded to the nested page flow, give it a chance to change the URI as the nested
        // flow is returning.  If it doesn't, we'll go to the originally-intended Forward.
        //
        ActionInterceptor interceptor = pushedPageFlowWrapper.getInterceptor();
               
        if ( interceptor != null )
        {
            return getRegisteredActionForwardHandler().handleInterceptorReturn( context, poppedPageFlow,
                                                                                pushedPageFlowWrapper, returnAction,
                                                                                mapping, form, interceptor );
        }

        //
        // Raise the returned action on the popped pageflow.
        //                   
        assert returnAction.charAt( 0 ) != '/' : returnAction;

        if ( _log.isDebugEnabled() )
        {
            _log.debug( "Action on popped PageFlowController is " + returnAction );
        }

        InternalStringBuilder returnActionPath = new InternalStringBuilder( poppedPageFlow.getModulePath() );
        returnActionPath.append( '/' ).append( returnAction ).append( PageFlowConstants.ACTION_EXTENSION );

        //
        // Store the returned form in the request.
        //
        ActionForm retForm = pageFlowFwd.getFirstOutputForm( request );
        if ( retForm != null )
        {
            InternalUtils.setForwardedFormBean( request, retForm );
            ImplicitObjectUtil.loadOutputFormBean( request, InternalUtils.unwrapFormBean( retForm ) );
        }
               
        // TODO: delete this deprecated feature (following line).  This is the Jpf.NavigateTo.page value.
        request.setAttribute( InternalConstants.RETURNING_FROM_NESTING_ATTR, Boolean.TRUE );
       
        //
        // Forward to the return-action on the nesting page flow.
        //
        ActionForward fwd = new ActionForward( returnActionPath.toString(), false );
        fwd.setContextRelative( true );
        return fwd;
    }
View Full Code Here

Examples of org.apache.beehive.netui.util.internal.InternalStringBuilder

            {
                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;
            }
View Full Code Here

Examples of org.apache.beehive.netui.util.internal.InternalStringBuilder

            return ret;
        }
       
        if ( _log.isErrorEnabled() )
        {
            InternalStringBuilder msg = new InternalStringBuilder( "Throwable " ).append( exClass.getName() );
            _log.error( msg.append( " unhandled by the current page flow (and any shared flow)" ).toString(), ex );
        }
      
        if ( ! getRegisteredExceptionsHandler().eatUnhandledException( context, ex ) )
        {
            // Throwing this ServletException derivative will prevent any outer try/catch blocks from re-processing
View Full Code Here

Examples of org.apache.beehive.netui.util.internal.InternalStringBuilder

            }
            else
            {
                if ( _log.isErrorEnabled() )
                {
                    InternalStringBuilder msg = new InternalStringBuilder( "Could not find exception handler method " );
                    msg.append( methodName ).append( " for " ).append( exClass.getName() ).append( '.' );
                    _log.error( msg.toString() );
                }
            }
        }
       
        return null;
View Full Code Here

Examples of org.apache.beehive.netui.util.internal.InternalStringBuilder

                LOGGER.error(msg);
                localRelease();
                return EVAL_PAGE;
            }

            InternalStringBuilder buf = new InternalStringBuilder();
            buf.append("<div");
            buf.append(" id=\"");
            buf.append(_divName);
            buf.append("\">\n<!--\n");
            buf.append(xmlText);
            buf.append("\n-->\n</div>");

            write(buf.toString());
        }
        else LOGGER.info("The object to serialize was not an XMLBean");

        localRelease();
View Full Code Here

Examples of org.apache.beehive.netui.util.internal.InternalStringBuilder

            throw new JspException(Bundle.getErrorString("DataGridTags_MissingDataGridModel"));

        int gridRenderState = dgm.getRenderState();
        if(gridRenderState == DataGridTagModel.RENDER_STATE_HEADER) {

            InternalStringBuilder content = new InternalStringBuilder();
            AbstractRenderAppender appender = new StringBuilderRenderAppender(content);

            StyleModel styleModel = dgm.getStyleModel();
            assert styleModel != null;

            TableRenderer tableRenderer = dgm.getTableRenderer();
            assert tableRenderer != null;

            if(dgm.isRenderRowGroups()) {
                _theadTag.styleClass = (_theadTag.styleClass != null ? _theadTag.styleClass : styleModel.getTableHeadClass());
                tableRenderer.openTableHead(_theadTag, appender);
            }

            TrTag.State trState = null;
            if(_renderRow) {
                trState = new TrTag.State();
                trState.styleClass = styleModel.getHeaderRowClass();
                tableRenderer.openHeaderRow(trState, appender);
            }

            JspFragment fragment = getJspBody();
            if(fragment != null) {
                StringWriter sw = new StringWriter();
                fragment.invoke(sw);
                appender.append(sw.toString());
            }

            if(_renderRow)
                tableRenderer.closeHeaderRow(appender);

            if(dgm.isRenderRowGroups()) {
                tableRenderer.closeTableHead(appender);
                String tfootScript = null;
                if(_theadTag.id != null) {
                    HttpServletRequest request = JspUtil.getRequest(getJspContext());
                    tfootScript = renderNameAndId(request, _theadTag, null);
                }

                if(tfootScript != null)
                    appender.append(tfootScript);
            }

            jspContext.getOut().write(content.toString());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.