Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extract path params from container request

Tags:

java

jersey

I am trying to implement ContainerRequestFilter and the method filter.

How can I extract he path params from ContainerRequest request?

I can only see a direct method to extract the query and form parameters.

like image 695
Dejell Avatar asked Oct 21 '22 08:10

Dejell


1 Answers

ContainerRequest doesn't seem to contain that information, but you can inject a UriInfo into the filter and use that. See UriInfo.getPathParameters().

Reference: How to get the value of a PathParam outside a Resource class

like image 157
Paul Bellora Avatar answered Oct 31 '22 00:10

Paul Bellora