Package javax.servlet.jsp.tagext

Examples of javax.servlet.jsp.tagext.BodyContent


    }

    @Override
    public int doEndTag() {
        try {
            BodyContent body = getBodyContent();

            if (body != null) {
                JspWriter out = body.getEnclosingWriter();
                String bodyString = body.getString();
                body.clearBody();
                out.print(bodyString);
            }
        } catch (IOException e) {
            System.out.println("IterateNext Tag error: " + e);
        }
View Full Code Here


    }

    @Override
    public int doEndTag() {
        try {
            BodyContent body = getBodyContent();

            if (body != null) {
                JspWriter out = body.getEnclosingWriter();
                String bodyString = body.getString();
                body.clearBody();
                out.print(bodyString);
            }
        } catch (IOException e) {
            System.out.println("IterateNext Tag error: " + e);
        }
View Full Code Here

            reportErrors();
            localRelease();
            return EVAL_PAGE;
        }

        BodyContent bc = getBodyContent();
        String content = (bc != null) ? bc.getString() : "";
        ResponseUtils.write(pageContext,content);
        ResponseUtils.write(pageContext,"</div>");
        localRelease();
        return EVAL_PAGE;
    }
View Full Code Here

            tc.secs.put(_name,s);
            localRelease();
            return EVAL_PAGE;
        }

        BodyContent bc = getBodyContent();
        String content = (bc != null) ? bc.getString() : "";
        tc.secs.put(_name,content);
        localRelease();
        return EVAL_PAGE;
    }
View Full Code Here

    /**
     * TODO: Ignore <!-- --> comments
     */
    private boolean isBodyContentEmpty()
    {
        BodyContent bodyContent = getBodyContent();
        if (bodyContent == null)
        {
            return true;
        }
        try
        {
            Reader reader = bodyContent.getReader();
            int c;
            while ((c = reader.read()) != -1)
            {
                if (!Character.isWhitespace((char)c))
                {
View Full Code Here

    private void flushWriter( JspWriter writerToFlush ) throws JspException,IOException {

      if (getFacesContext() == null)
            return;
      BodyContent tempwriter;
      _componentInstance = findComponent(_facesContext);
      if (writerToFlush instanceof BodyContent)
        {
            int count = 0;
            char [] readChars = new char[READ_LENGTH];
            tempwriter = (BodyContent) writerToFlush;
            Reader read =tempwriter.getReader();
            count = read.read(readChars,0,READ_LENGTH);
            String readString = new String(readChars,0,count);
            if(!readString.trim().equals(""))
            {
                //_componentInstance = findComponent(_facesContext);
                UIComponentTag parentTag = getParentUIComponentTag(pageContext);
                addOutputComponentAfterComponent(parentTag,createUIOutputComponentFromString(readString),_componentInstance);
                tempwriter.clearBody();
            }

        }
        else
      {
View Full Code Here

        FacesContext facesContext = FacesContext.getCurrentInstance();
        if (!isPartialStateSavingOn(facesContext))
        {
            try
            {
                BodyContent bodyContent = getBodyContent();
                if (bodyContent != null)
                {
                    StateManager stateManager = facesContext.getApplication().getStateManager();
                    StateManager.SerializedView serializedView
                            = stateManager.saveSerializedView(facesContext);

                    //until now we have written to a buffer
                    ResponseWriter bufferWriter = facesContext.getResponseWriter();
                    bufferWriter.flush();
                    //now we switch to real output
                    ResponseWriter realWriter = bufferWriter.cloneWithWriter(getPreviousOut());
                    facesContext.setResponseWriter(realWriter);

                    String bodyStr = bodyContent.getString();
                  /*
                    do this always - even with server-side-state saving
                    if ( stateManager.isSavingStateInClient(facesContext) )
                    { */

 
View Full Code Here

        FacesContext facesContext = FacesContext.getCurrentInstance();
        if (!isPartialStateSavingOn(facesContext))
        {
            try
            {
                BodyContent bodyContent = getBodyContent();
                if (bodyContent != null)
                {
                    StateManager stateManager = facesContext.getApplication().getStateManager();
                    StateManager.SerializedView serializedView
                            = stateManager.saveSerializedView(facesContext);

                    //until now we have written to a buffer
                    ResponseWriter bufferWriter = facesContext.getResponseWriter();
                    bufferWriter.flush();
                    //now we switch to real output
                    ResponseWriter realWriter = bufferWriter.cloneWithWriter(getPreviousOut());
                    facesContext.setResponseWriter(realWriter);

                    String bodyStr = bodyContent.getString();
                  /*
                    do this always - even with server-side-state saving
                    if ( stateManager.isSavingStateInClient(facesContext) )
                    { */

 
View Full Code Here

        _escape = escape;
    }
   
    public int doAfterBody() throws JspException
    {
        BodyContent bodyContent = getBodyContent();
        if (bodyContent != null)
        {
            UIOutput component = (UIOutput)getComponentInstance();
            component.setValue(bodyContent.getString());
        }
        return super.doAfterBody();
    }
View Full Code Here

    private void flushWriter( JspWriter writerToFlush ) throws JspException,IOException {

      if (getFacesContext() == null)
            return;
      BodyContent tempwriter;
      _componentInstance = findComponent(_facesContext);
      if (writerToFlush instanceof BodyContent)
        {
            int count = 0;
            char [] readChars = new char[READ_LENGTH];
            tempwriter = (BodyContent) writerToFlush;
            Reader read =tempwriter.getReader();
            count = read.read(readChars,0,READ_LENGTH);
            String readString = new String(readChars,0,count);
            if(!readString.trim().equals(""))
            {
                //_componentInstance = findComponent(_facesContext);
                UIComponentTag parentTag = getParentUIComponentTag(pageContext);
                addOutputComponentAfterComponent(parentTag,createUIOutputComponentFromString(readString),_componentInstance);
                tempwriter.clearBody();
            }

        }
        else
      {
View Full Code Here

TOP

Related Classes of javax.servlet.jsp.tagext.BodyContent

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.