Thread: In jax-rs if multiple resource methods are annotated with same http method designators

Forum : Restful Services.   14 Apr, 2018 20:03
User Image
KarthikReddy

Newbie

Joined: 13 Jun, 2017

Points: 110

Threads: 25

Posts: 9

In jax-rs if multiple resource methods are annotated with same http method designators

| Quote Date : 14 Apr, 2018    Views:383    

What is the result in case of Jersey and what is in case of RestEasy.?

Here is the sample code

@Path("/check")
public class TrainAvailability {
@GET
@Produces(MediaType.APPLICATION_XML)
public String getTrains(@QueryParam("source") String source, @QueryParam("destination") String destination) {
return "<trains><train><train-name>" + source + destination + "</train-name></train></trains>";
}
@GET
@Produces(MediaType.APPLICATION_XML)
public String getSeats(@PathParam("trainNo") int trainNo) {
return "<seats>" + trainNo + "</seats>";
}
}

Load More

No More Comments