我有这个客户端角度1.5代码
var getGroupForUser = function () {
var deferred = $q.defer();
$http.get(env.domain+'/Voices/authorize').then(
function successCallback(response) {
// self.isAdOps = response.data.;
deferred.resolve(response.data);
}, function errorCallback(response) {
console.log(response.data.errorMsg);
self.isAdOps = true;
deferred.reject("data: "+response.data+" code:"+response.status+" "+response.statusText+", please look at the web console");
});
return deferred.promise;
};
和服务器上的这个jersey java代码:
@Path("/Voices")
public class VoicesOperation {
@Path("/search")
@GET
@Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
public List<VoiceUi> search(@QueryParam("q") String searchTerm) throws Exception {...
}
@Path("/authorize")
@GET
@Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
public String authorize() {
logger.info("in voicesOperation - authorization");
logger.error("checking error log ==== in voicesOperation - authorization");
然而,我在服务器中遇到错误:
javax.ws.rs.NotFoundException: HTTP 404 Not Found
我错过了什么?
答案 0 :(得分:0)
只需修改下面的内容,然后尝试: -
public String authorize(@Context UriInfo info) {
.
.
}