Search code examples
javaweb-servicesjerseyservlet-filters

What is a Jersey Filter?


I want to know basically what a Jersey filter is and how is it related to a servlet filter? Are they the same? What are the main patterns of using a Jersey Filter?


Solution

  • The first part of your question may be answered in the Jersey documentation. A Jersey filter is not the same as a servlet filter. There are two filters included in Jersey, a filter for logging requests and one for compression (GZip). Another use case for a custom filter would be authentication or authorization.