title: Spring - Execute code before controller's method is invoked
body: <p>Is there any annotation similar to <code>@PreAuthorize</code> or <code>@PreFilter</code> that I can use to run code before a method in the Controller is invoked?</p>
  
  <p>I need to add info to the request context (specific to the method being called) to be then retrieved by the <code>ExceptionHandler</code>.</p>
  
  <p>For example</p>
  
  <pre><code>@RestController
  public MyController{
  
    @UnkwonwAnnotation("prepareContext(request.getAgentId())"){
    public ResponseEntity method1(RequestA requestA) {
      ...
    }
  
    @UnkwonwAnnotation("prepareContext(request.getUserName())"){
    public ResponseEntity method1(RequestB requestB) {
      ...
    }
  
  }
  </code></pre>
  
  <p>I could actually just use <code>@PreAuthorize</code> but doesn't feel right</p>