Header filters in @RequestMapping can also be negated using the notations "!header-name" and "header!=value". From the Spring documentation:
Expressions can be negated by using the "!=" operator, as in "My-Header!=myValue". "My-Header" style expressions are also supported, with such headers having to be present in the request (allowed to have any value).
Finally, "!My-Header" style expressions indicate that the specified header is not supposed to be present in the request.
Also supports media type wildcards (*), for headers such as Accept and Content-Type. For instance:
Header filters in
@RequestMapping
can also be negated using the notations "!header-name" and "header!=value". From the Spring documentation: