Search code examples
jerseyjava-ee-7

Routing all Jersey REST requests through a method prior to execution


What I would like to do is define a method at the root resource level that is called prior to any sub resources of that class. Looking through the API I see nothing like this.

Jersey 1.6


Solution

  • Well, the simplest way to do so is to have no-arg constructor of your Controller and call whichever function you want from there.