Can I check http headers within a JAX-RS application using Interceptors?

FlaleNevegalt

New Member
Should \[code\]@Context HttpHeaders\[/code\] work within an \[code\]Interceptor\[/code\]?I've created a \[code\]RestfulClasses\[/code\] class that extends \[code\]javax.ws.rs.core.Application\[/code\] and annotated it \[code\]@javax.ws.rs.ApplicationPath("/api")\[/code\] - all pretty standard stuff.I also have a class, added to handle a particular path, which itself works fine. Trouble is I would like to check incoming HTTP headers, and using interceptors sounds perfect.My interceptor class has an \[code\]@Context HttpHeaders httpHeaders\[/code\] declared, but within the \[code\]@AroundInvoke\[/code\] method this property is null.Should I expect this to work or am I missing something? Is there another way?
 
Top