Answer the question
In order to leave comments, you need to log in
Java REST. How to write a path like /get/group1/group2/... in Path?
Good afternoon.
I need to write in @Path something like /get/group1/group2/...... and so on. That is, I do not know the number of groups.
Here, with this writing, everything that is after get/ is read into id. And I want to accept id as a List
@GET
@Path(value = "get/{id : .+}/")
@Produces(MediaType.APPLICATION_JSON)
.....
Answer the question
In order to leave comments, you need to log in
And why are you doing this through Get, make a request for groups or whatever you want to give through the post. For example, on the url - /get/groups they send you a list of groups in json and you will take them from there. So the mapping will be cleaner.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question