Class AddResponseHeaderFilter

java.lang.Object
com.aoapps.servlet.filter.AddResponseHeaderFilter
All Implemented Interfaces:
Filter

public class AddResponseHeaderFilter extends Object implements Filter
Adds headers to the response of any filter-mapping that is sent to this filter. Headers are added before the filter chain is called.

Due to the limitations of filter mapping URLs, patterns may be provided and handled by this filter itself. All patterns and regular expressions will be evaluated and any match is considered a match overall. There is currently no support for negation.

Each header name that does not specify a pattern is taken directly from the filter init parameters.

This should be used for the DispatcherType.REQUEST dispatcher only.

Init Parameters:
    allowMultiple (Optional) Allow multiple headers of the same name?  Defaults to "true".
    Request filter:
        patterns  (Optional) Comma/space-separated list of patterns (default to *)
        regex     (Optional) zeroth regular expression to match
        regex.1   (Optional) first regular expression to match
        regex.2   (Optional) second regular expression to match
        regex.n   (Optional) nth regular expression to match
    TODO: Support Additional per-header filters?
        name.patterns  (Optional) Comma/space-separated list of patterns (default to *)
        name.regex     (Optional) zeroth regular expression to match
        name.regex.1   (Optional) first regular expression to match
        name.regex.2   (Optional) second regular expression to match
        name.regex.n   (Optional) nth regular expression to match
    Header:
        name=value
See Also: