我有一個Java的web服務方法,其中在地方的回報則顯示爲錯誤The method ok() is undefined for the type Response
這裏是我的代碼如下Java Webservice方法返回顯示爲編譯類型錯誤?
@Path("/deleteMethod")
@GET
@Produces({"application/json"})
public Response deleteServiceMethod(@QueryParam("allPatients") boolean allPatients, @QueryParam("PatientName") String PatientName, @QueryParam("PatientPlace") String PatientPlace)
throws IOException, InterruptedException
{
//my logic is present here
return Response.ok().build();
}
可有人告訴我這是什麼樣的錯誤,我應該需要添加任何廣口瓶爲了這?
檢查你的Response類,從你導入了哪個包?它應該是:'javax.ws.rs.core.Response' – ACV
@ACV,我已經添加了,雖然它顯示相同的錯誤 – khanam
我可以知道爲什麼投票下來嗎? – khanam