1 of 1 people found this helpful
Is the @Context UriInfo available if used as a method parameter?
Thanks a bunch! Making it a method parameter solved the problem. Strange that it wouldn't work as a member variable though.
Don't know. 5.2.2 of the spec says
An instance of UriInfo can be injected into a class ﬁeld or method parameter using the @Context annotation
Tried a simple
public class Status
and put a breakpoint in one my called methods and I did manage to get a non-null instance on 7.1.1 so it's not a direct bug, I think
Well, I thought this was resolved, but now I am seeing inconsistent results. In summary
- We are using the CXF JAX-RS implementation
- If I use the context annotation for a member variable, it is always null
- If I use it as a method parameter, sometimes it is null, and sometimes it is not. I could not determine a clear pattern for what is causing it to be one way or another.
- Either way works fine in Weblogic