У меня есть фильтр, и я хочу получить имя API в фильтре.Как я могу получить это.Итак, в TestFilter я хочу имя метода, т.е. getUsers.
@Path("v1/path")
@Consumes({ APPLICATION_JSON })
@Produces({ APPLICATION_JSON })
public interface RestController {
@Path("/users")
@Get
@Produces({ APPLICATION_JSON })
public Response getUsers(@PathParam("User-Id") String userId);
}
public class RestImpl implements RestController{
@Override
public Response getUsers(String userId){
// some logic to fetch users details
}
}
public class TestFilter implements ContainerResponseFilter {
@Override
public void filter(ContainerRequestContext requestContext,ContainerResponseContext responseContext){
// here I want to fetch the method name - getUsers
}
}