Spring Framework BindStatus - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework BindStatus class.

This code example shows how to use the following methods:getActualValue, getEditor, getValue
	 */ 
	private static final String SELECTED_ATTRIBUTE = "selected"; 
 
	/** 
	 * The name of the '{@code value}' attribute. 
	 */ 
	private static final String VALUE_ATTRIBUTE = VALUE_VARIABLE_NAME; 
 
	/** 
	 * The name of the '{@code disabled}' attribute. 
	 */ 
	private static final String DISABLED_ATTRIBUTE = "disabled"; 
 
 
	/** 
	 * The 'value' attribute of the rendered HTML {@code <option>} tag. 
	 */ 
	private Object value; 
 
	/** 

7
CodeRank
This code example shows how to use the following methods:
				resolvedPath = nestedPath + resolvedPath; 
			} 
		} 
 
		try { 
			this.status = new BindStatus(getRequestContext(), resolvedPath, isHtmlEscape()); 
		} 
		catch (IllegalStateException ex) { 
			throw new JspTagException(ex.getMessage()); 
		} 
 
		// Save previous status values, for re-exposure at the end of this tag. 
		this.previousPageStatus = pageContext.getAttribute(STATUS_VARIABLE_NAME, PageContext.PAGE_SCOPE); 
		this.previousRequestStatus = pageContext.getAttribute(STATUS_VARIABLE_NAME, PageContext.REQUEST_SCOPE); 
 
		// Expose this tag's status object as PageContext attribute, 
		// making it available for JSP EL. 
		pageContext.removeAttribute(STATUS_VARIABLE_NAME, PageContext.PAGE_SCOPE); 
		pageContext.setAttribute(STATUS_VARIABLE_NAME, this.status, PageContext.REQUEST_SCOPE); 
 

6
CodeRank
This code example shows how to use the following methods:getExpression
	 * but <i>not</i> prefixed with the name of the form attribute. 
	 * @see #getNestedPath() 
	 * @see #getPath() 
	 */ 
	protected String getPropertyPath() throws JspException { 
		String expression = getBindStatus().getExpression(); 
		return (expression != null ? expression : ""); 
	} 
 
	/** 
	 * Get the bound value. 
	 * @see #getBindStatus() 
	 */ 
	protected final Object getBoundValue() throws JspException { 
		return getBindStatus().getValue(); 
	} 
 
	/** 
	 * Get the {@link PropertyEditor}, if any, in use for value bound to this tag. 
	 */ 
6
CodeRank
This code example shows how to use the following methods:
 
	/** 
	 * @see org.springframework.web.servlet.support.RequestContext#getBindStatus(String) 
	 */ 
	public BindStatus getBindStatus(String path) throws IllegalStateException { 
		return new BindStatus(new RequestContext(this.request), path, false); 
	} 
 
	/** 
	 * @see org.springframework.web.servlet.support.RequestContext#getBindStatus(String, boolean) 
	 */ 
	public BindStatus getBindStatus(String path, boolean htmlEscape) throws IllegalStateException { 
		return new BindStatus(new RequestContext(this.request), path, true); 
	} 
 
} 
5
CodeRank
This code example shows how to use the following methods:getActualValue, getEditor, getValue

5
CodeRank
This code example shows how to use the following methods:findEditor
	/** 
	 * Determines the display value of the supplied {@code Object}, 
	 * HTML-escaped as required. 
	 */ 
	private String getDisplayString(Object value) { 
		PropertyEditor editor = (value != null ? this.bindStatus.findEditor(value.getClass()) : null); 
		return ValueFormatter.getDisplayString(value, editor, this.htmlEscape); 
	} 
 
	/** 
	 * Process the option value before it is written. 
	 * The default implementation simply returns the same value unchanged. 
	 */ 
	protected String processOptionValue(String resolvedValue) { 
		return resolvedValue; 
	} 
 
	/** 
	 * Determine whether the supplied values matched the selected value. 
	 * Delegates to {@link SelectedValueComparator#isSelected}. 
5
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:getExpression
    @Override 
    protected ProcessorResult doProcess(final Arguments arguments, final Element element,
            final String attributeName, final String attributeValue, final BindStatus bindStatus,
            final Map<String, Object> localVariables) {
 
        String name = bindStatus.getExpression();
        name = (name == null? "" : name);
 
        final String value = element.getAttributeValue("value");
        if (value == null) {
            throw new TemplateProcessingException( 
                    "Attribute \"value\" is required in \"option\" tags"); 
        } 
         
        final boolean selected = 
            SelectedValueComparatorWrapper.isSelected(bindStatus, value);
 
        element.setAttribute("value", value);
        element.setAttribute( 
                "value", 
4
CodeRank
This code example shows how to use the following methods:getExpression
    @Override 
    protected ProcessorResult doProcess(final Arguments arguments, final Element element,
            final String attributeName, final String attributeValue, final BindStatus bindStatus,
            final Map<String, Object> localVariables) {
 
        String name = bindStatus.getExpression();
        name = (name == null? "" : name);
 
        final String value = element.getAttributeValue("value");
        if (value == null) {
            throw new TemplateProcessingException( 
                    "Attribute \"value\" is required in \"option\" tags"); 
        } 
         
        final boolean selected = 
            SelectedValueComparatorWrapper.isSelected(bindStatus, value);
 
        element.setAttribute("value", value);
        element.setAttribute( 
                "value", 
4
CodeRank
See Code Examples for Spring Framework BindStatus Methods: