public int doEndTag() throws JspException
    {
        ServletRequest req = pageContext.getRequest();

        // Create an appropriate "input" element based on our parameters
        if (_password) {
            _state.type = INPUT_PASSWORD;
        }
        else {
            _state.type = INPUT_TEXT;
        }


        // Create the state for the input tag
        ByRef ref = new ByRef();
        nameHtmlControl(_state, ref);

        _state.disabled = isDisabled();

        // Create the text value of the TextBox
        Object textObject = evaluateDataSource();
        if ((textObject == null) || (textObject.toString().length() == 0)) {
            textObject = _defaultValue;
        }

        // Get the text value for the textbox, the result
        String text = null;
        if (textObject != null) {
            text = formatText(textObject);
            InternalStringBuilder sb = new InternalStringBuilder(text.length() + 16);
            StringBuilderRenderAppender sbAppend = new StringBuilderRenderAppender(sb);
            HtmlUtils.filter(text, sbAppend);
            text = sb.toString();
        }
        _state.value = text;

        // if there were format errors then report them
        if (_formatErrors) {
            if (bodyContent != null) {
                String value = bodyContent.getString().trim();
                bodyContent.clearBody();
                write(value);
            }
        }

        if (hasErrors())
            return reportAndExit(EVAL_PAGE);

        // create the input tag.
        WriteRenderAppender writer = new WriteRenderAppender(pageContext);
        TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_TEXT_TAG, req);
        assert(br != null);

        br.doStartTag(writer, _state);
        br.doEndTag(writer);

        // write any script that needs to be written
        if (!ref.isNull())
            write((String) ref.getRef());

        localRelease();
        return EVAL_PAGE;
    }
public int doEndTag ( ) throws JspException { ServletRequest req = pageContext . getRequest ( ) ; if ( _password ) { _state . type = INPUT_PASSWORD ; } else { _state . type = INPUT_TEXT ; } ByRef ref = new ByRef ( ) ; nameHtmlControl ( _state , ref ) ; _state . disabled = isDisabled ( ) ; Object textObject = evaluateDataSource ( ) ; if ( ( textObject == null ) || ( textObject . toString ( ) . length ( ) == 0 ) ) { textObject = _defaultValue ; } String text = null ; if ( textObject != null ) { text = formatText ( textObject ) ; InternalStringBuilder sb = new InternalStringBuilder ( text . length ( ) + 16 ) ; StringBuilderRenderAppender sbAppend = new StringBuilderRenderAppender ( sb ) ; HtmlUtils . filter ( text , sbAppend ) ; text = sb . toString ( ) ; } _state . value = text ; if ( _formatErrors ) { if ( bodyContent != null ) { String value = bodyContent . getString ( ) . trim ( ) ; bodyContent . clearBody ( ) ; write ( value ) ; } } if ( hasErrors ( ) ) return reportAndExit ( EVAL_PAGE ) ; WriteRenderAppender writer = new WriteRenderAppender ( pageContext ) ; TagRenderingBase br = TagRenderingBase . Factory . getRendering ( TagRenderingBase . INPUT_TEXT_TAG , req ) ; assert ( br != null ) ; br . doStartTag ( writer , _state ) ; br . doEndTag ( writer ) ; if ( ! ref . isNull ( ) ) write ( ( String ) ref . getRef ( ) ) ; localRelease ( ) ; return EVAL_PAGE ; }
Render the TextBox.
@throws JspException if a JSP exception has occurred