I would like to have two GET
methods on my Rest resource class.
one would react if query param has value1
and second on value2
Lets say:
@Path("/myApi")
public class MyApiService {
@GET
@Produces(MediaType.APPLICATION_JSON)
public Response methodOne(...) {
...
return ...;
}
@GET
@Produces(MediaType.APPLICATION_JSON)
public Response methodTwo(...) {
...
return ...;
}
How to achieve conditional routing for query params
I would like to methodOne()
reacts if QueryParam
is ?type=one
and methodTwo()
if QueryParam
is ?type=two