title: How to write a custom filter in spring security?
body: <p>I want to receive some information per request, so I think instead of having a function for each request and obtaining those information from requests separately, <b>it's better to have a filter.<br>
  So every request shall pass that filter and I gain what I want.</b><br>
  <br>
  The question is: How can I write a custom filter?<br>
  <em>Suppose it is not like any predefined spring security filters and it is totally new.</em></p>