Tag: securitycontext

Custom Response Types in Jersey SecurityContext

Sometimes you might need to return custom response types in your SecurityContext implementation when using Jersey RESTFul web services. Basically, there are two options available to do so: Use javax.ws.rs.core.Response and throw a WebApplicationException or write your own ExceptionMapper Throw WebApplicationException Custom ExceptionMapper The other (even nicer option) is to write your own ExceptionMapper: