나는 dropwizard.io 응용 프로그램을 가지고, 문제는 내 자원과 같은, GET 요청에 있습니다 :보내기 대신에 405 느릅 나무 빈 WebApplicationException의 404
@Path("/foobar")
public class FooBarResource
(...)
@GET
@Path("/{id}")
@UnitOfWork
public Response getFooBar(@PathParam("id") Long id){
return Response.status(200).entity(FooBarService.get(id)).build();
}
@DELETE
@Path("/{id}")
@UnitOfWork
public Response getFooBar(@PathParam("id") Long id){
return Response.status(200).entity(FooBarService.delete(id)).build();
}
@PUT
@Path("/{id}")
@UnitOfWork
public Response getFooBar(@PathParam("id") Long id, FooBar fooBar){
return Response.status(204).entity(FooBarService.update(id, fooBar)).build();
}
}
을 그리고 나는 GET localhost:port/appPath/foobar/
를 보낼 때 내가 대신 405을 404를 얻으려면 어떻게해야합니까? 내 응용 프로그램을 디버깅 할 때 내가 가지고있는 것은 javax.ws.rs.WebApplicationException
이지만 비어 있습니다. 포트/appPath /는 foobar/당신이 (방법은 허용되지 않습니다) (405)를 얻을 :
localhost : port/appPath/foobar /'에 대해 'GET'과 일치하는 다른 메소드가 있습니까? –
전체 앱에 없음 – gniadson
이것이 도움이 될 수 있는지 확인하십시오. http://stackoverflow.com/questions/25040222/restful-services-sending-http-405-instead-of-http-500-error – thepace