この単純な RestEasy サービスに問題があります。
@Path("/")
public interface UserService {
@POST
@Path("/add")
@Consumes(MediaType.APPLICATION_JSON)
Response add(User user);
@POST
@Path("/update")
@Consumes(MediaType.APPLICATION_JSON)
Response update(User user);
@GET
@Path("/get/{id}")
@Produces(MediaType.APPLICATION_JSON)
Response get(@PathParam("id") long id);
@GET
@Path("/getAll")
@Produces(MediaType.APPLICATION_JSON)
Response getAll();
}
基本的に、上記のコードは機能しますが、次のように変更し@Path("/")
て@Path("/user")
リソースにアクセスすると、
http://localhost:8080/user/add
エラーがスローされます404
。動作するオリジナルとは異なりhttp://localhost:8080/UserService/add
ます。
コードに何か不足していますか?