@Path("motorcycle")
public class MotorcycleRecource {
@GET
@Path("/search")
@Produces("application/json")
public Motorcycle getMotorcycleByYear(@QueryParam("year") Integer year) {
return motorcycleService.getMotorcycleByYear(year);
}
@GET
@Path("/search")
@Produces("application/json")
public Motorcycle getMotorcycleByEngineCapacity(@QueryParam("engineCapacity") Integer engineCapacity) {
return motorcycleService.getMotorcycleByEngineCapacity(engineCapacity);
}
}
I want to create 2 mappings on my server with the same path, but when I try that compiler gives tons of errors and exceptions I want both mappings to be on motorcycle/search mapping so i can do motorcycle/search?year= motorcycle/search?engineCapacity=