0
@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=

  • *compiler gives tons of errors*: I doubt that, because the compiler doesn't care about that. But if that's the case, what you need to do is **read**, or at least **post** the errors. – JB Nizet Jan 14 '18 at 14:36
  • at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) at – Nikolay Romanov Jan 14 '18 at 14:52
  • I can't post all of them – Nikolay Romanov Jan 14 '18 at 14:52

0 Answers0