3
我試圖用angularjs-Java的REST調用使用angularjs與參數值的方式
的Java代碼,以使REST調用java中: -
@GET
@Path("/getData/{id}")
@Produces(MediaType.TEXT_PLAIN)
public static String getData(@PathParam("id") String id) {
//Operation
}
AngularJs REST呼叫 -
var response = $http.get('/projName/rest/get/getData', {params: {id: id}});
但它給我的例外 -
org.jboss.resteasy.spi.No tFoundException:無法找到完整路徑的資源:
日Thnx的答案,我找不到了,@PathVariable javax.ws包中的註釋? – deen
@rish我更新了我的答案。我首先給你Spring方法 – xenteros
非常感謝,在@PathParam鍵名應該出現之後,我會在這裏添加一些內容,比如@PathParam(「id」) – deen