title: Access iriInfo in called Method
body: <p>This code works to access the uriInfo: </p>
  
  <pre><code>@Path("/testing")
  public class Testing {
      @javax.ws.rs.core.Context UriInfo uriInfo;  
  
  @POST
  @Path("/test2")
  @Produces(MediaType.TEXT_PLAIN)
  public Response test2(
    @FormParam("sessionId") String sessionId ) {
  
    String currentUserId = Utils.setup(sessionId); 
  
    String accessPath = uriInfo.getAbsolutePath().toASCIIString();
    System.out.println("The client used this URI to reach this resource method: " + uriInfo.getAbsolutePath().toASCIIString());
  
  //  Utils.test3("print this"); 
      return Response.ok("Test 2 ended").build();
  
          }       
  </code></pre>
  
  <p>When I try to access the uriInfo in the called method Utils.test3("print this");  Here: </p>
  
  <pre><code>public class Utils { 
   @javax.ws.rs.core.Context static UriInfo uriInfo;  
  
  public static String setup(String sessionId) {
  
    if (!com.retailapppartners.Utils.validSession(sessionId)) {
        throw new WebApplicationException(Response.Status.UNAUTHORIZED);
    }
  
    String currentUserId = com.retailapppartners.Utils.getUserFromSession(sessionId);
    MDC.put("user-id", currentUserId);
  
    return currentUserId;
    }
  
  public static void test3(String message) {
  
      System.out.println(message);
      String path = uriInfo.getPath(); 
  //      System.out.println("The client used this URI: " + uriInfo.getAbsolutePath().toASCIIString());
  
      return; 
  </code></pre>
  
  <p>}   </p>
  
  <p>This fails with null pointer exception.  I want to see the path uri in the called method to confirm security for all methods in my utils called method.  I have searched hi and low for called examples of this.  Thanks</p>