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

Forum : Restful Services.   5 Days ago
User Image
KarthikReddy

Newbie

Joined: Jun 13, 2017

Points: 100

Threads: 20

Posts: 8

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

| Quote Date : Apr 14, 2018    Views:46    

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