Interface RequestDataValueProcessor

  • public interface RequestDataValueProcessor
    A contract for inspecting and potentially modifying request data values such as URL query parameters or form field values before they are rendered by a view or before a redirect.

    Implementations may use this contract for example as part of a solution to provide data integrity, confidentiality, protection against cross-site request forgery (CSRF), and others or for other tasks such as automatically adding a hidden field to all forms and URLs.

    View technologies that support this contract can obtain an instance to delegate to via RequestContext.getRequestDataValueProcessor().

    Rossen Stoyanchev
    • Method Detail

      • processAction

        java.lang.String processAction(HttpServletRequest request,
                                       java.lang.String action,
                                       java.lang.String httpMethod)
        Invoked when a new form action is rendered.
        request - the current request
        action - the form action
        httpMethod - the form HTTP method
        the action to use, possibly modified
      • processFormFieldValue

        java.lang.String processFormFieldValue(HttpServletRequest request,
                                               java.lang.String name,
                                               java.lang.String value,
                                               java.lang.String type)
        Invoked when a form field value is rendered.
        request - the current request
        name - the form field name (if any)
        value - the form field value
        type - the form field type ("text", "hidden", etc.)
        the form field value to use, possibly modified
      • getExtraHiddenFields

        java.util.Map<java.lang.String,java.lang.String> getExtraHiddenFields(HttpServletRequest request)
        Invoked after all form fields have been rendered.
        request - the current request
        additional hidden form fields to be added, or null if none
      • processUrl

        java.lang.String processUrl(HttpServletRequest request,
                                    java.lang.String url)
        Invoked when a URL is about to be rendered or redirected to.
        request - the current request
        url - the URL value
        the URL to use, possibly modified