Example usage for org.springframework.web.servlet.tags.form OptionTag VALUE_VARIABLE_NAME

List of usage examples for org.springframework.web.servlet.tags.form OptionTag VALUE_VARIABLE_NAME

Introduction

In this page you can find the example usage for org.springframework.web.servlet.tags.form OptionTag VALUE_VARIABLE_NAME.

Prototype

String VALUE_VARIABLE_NAME

To view the source code for org.springframework.web.servlet.tags.form OptionTag VALUE_VARIABLE_NAME.

Click Source Link

Document

The name of the JSP variable used to expose the value for this tag.

Usage

From source file:org.hdiv.web.servlet.tags.form.OptionTagHDIV.java

@Override
protected void renderDefaultContent(TagWriter tagWriter) throws JspException {
    Object value = this.pageContext.getAttribute(OptionTag.VALUE_VARIABLE_NAME);
    String label = getLabelValue(value);
    renderOption(value, label, tagWriter);
}

From source file:org.hdiv.web.servlet.tags.form.OptionTagHDIV.java

@Override
protected void renderFromBodyContent(BodyContent bodyContent, TagWriter tagWriter) throws JspException {
    Object value = this.pageContext.getAttribute(OptionTag.VALUE_VARIABLE_NAME);
    String label = bodyContent.getString();
    renderOption(value, label, tagWriter);
}

From source file:org.hdiv.web.servlet.tags.form.OptionTagHDIV.java

@Override
protected void exposeAttributes() throws JspException {
    Object value = resolveValue();
    this.oldValue = this.pageContext.getAttribute(OptionTag.VALUE_VARIABLE_NAME);
    this.pageContext.setAttribute(OptionTag.VALUE_VARIABLE_NAME, value);
    this.oldDisplayValue = this.pageContext.getAttribute(OptionTag.DISPLAY_VALUE_VARIABLE_NAME);
    this.pageContext.setAttribute(DISPLAY_VALUE_VARIABLE_NAME,
            getDisplayString(value, getBindStatus().getEditor()));
}

From source file:org.hdiv.web.servlet.tags.form.OptionTagHDIV.java

@Override
protected void removeAttributes() {
    if (this.oldValue != null) {
        this.pageContext.setAttribute(VALUE_ATTRIBUTE, this.oldValue);
        this.oldValue = null;
    } else {//from  ww  w. j  av a2s.  c  o m
        this.pageContext.removeAttribute(OptionTag.VALUE_VARIABLE_NAME);
    }

    if (this.oldDisplayValue != null) {
        this.pageContext.setAttribute(DISPLAY_VALUE_VARIABLE_NAME, this.oldDisplayValue);
        this.oldDisplayValue = null;
    } else {
        this.pageContext.removeAttribute(DISPLAY_VALUE_VARIABLE_NAME);
    }
}

From source file:org.hdiv.web.servlet.tags.form.OptionTagHDIV.java

private Object resolveValue() throws JspException {
    return evaluate(OptionTag.VALUE_VARIABLE_NAME, getValue());
}