i am using jersey to build a REST webservice.
I created a class, implementing the ContainerRequestFilter interface to determine whether a user is logged in or not. Now I ‘d like to discard each request that is submitted if user == null. How can this be achieved? I don’t want to put a
if (user != null ) {
...
} else {
return //401
}
in each action.
throw WebApplicationException: