Example usage for org.springframework.web.servlet.support RequestDataValueProcessor processFormFieldValue

List of usage examples for org.springframework.web.servlet.support RequestDataValueProcessor processFormFieldValue

Introduction

In this page you can find the example usage for org.springframework.web.servlet.support RequestDataValueProcessor processFormFieldValue.

Prototype

String processFormFieldValue(HttpServletRequest request, @Nullable String name, String value, String type);

Source Link

Document

Invoked when a form field value is rendered.

Usage

From source file:org.kmnet.com.fw.web.mvc.support.CompositeRequestDataValueProcessor.java

/**
 * Calls the {@code processFormFieldValue()} method of all the {@link RequestDataValueProcessor} implementations <br>
 * this class holds.//  ww w  . j  a  v  a 2s  .  c  o m
 * @param value the form field value.must not be null.
 * @see org.springframework.web.servlet.support.RequestDataValueProcessor#processFormFieldValue(javax.servlet.http.HttpServletRequest,
 *      java.lang.String, java.lang.String, java.lang.String)
 */
@Override
public String processFormFieldValue(HttpServletRequest request, String name, String value, String type) {

    String result = value;
    for (RequestDataValueProcessor processor : processors) {
        result = processor.processFormFieldValue(request, name, value, type);
        if (!value.equals(result)) {
            break;
        }
    }

    return result;
}

From source file:com.trenako.web.tags.LocalizedTextAreaTags.java

protected final String processFieldValue(String name, String value, String type) {
    RequestDataValueProcessor processor = getRequestContext().getRequestDataValueProcessor();
    ServletRequest request = this.pageContext.getRequest();
    if (processor != null && (request instanceof HttpServletRequest)) {
        value = processor.processFormFieldValue((HttpServletRequest) request, name, value, type);
    }// w  w w . j  a v a  2 s  . com
    return value;
}