2

I have what I feel should be a quick question, but perhaps I'm not too sure on the proper terminology to be searching under for the answer to this question.

I currently am running Jetty 9.2 web server with Jersey 2.0. I successfully have been able to map url templates to requests as seen below:

@GET
@Path("/box/{boxId}/container/{containerId}/")
@Produces(MediaType.TEXT_PLAIN)
public String GetBoxContainer(@PathParam("boxId") int boxId,
        @PathParam("containerId") String containerId) {
    ....
}

I have also put a filter in front as seen below:

public class AuthenticationFilter implements ContainerRequestFilter{
    public void filter(ContainerRequestContext requestContext) {
        System.out.println("Hello Authentication filter!!!");
    }
}

Is there a similar way I can do a similar @Path("...") inside of the filter? It would be the same authentication argument requirement for GET/POST/PUT etc... Authentication of this resource is dependent on boxId and containerId.

I think something along the lines of Name Binding is what I'm looking for, but not positive.

Community
  • 1
  • 1
Deftness
  • 265
  • 1
  • 4
  • 21

0 Answers0