I have problem in callback function in jquery.
lets start from the beginning. My restful web service url is this
http://localhost :35055/new/webresources/generic/1
and it will return
{'name':'get', 'age':58}
and my jquery to interact with this web service is
$(document).ready(function() {
$.ajax({
dataType: "json",
url: '/webresources/generic/1',
type: 'GET',
data: ' ',
success: function() {
alert('PUT completed');
}
});
});
which is linked in the jsp page
http://localhost:35055/new/tool.jsp
there is no alert message. Please suggest me a way and also debug this code please.
this is the restful webservice
@GET
@Produces("application/json")
public String getJson( @PathParam("venki") int empno ) {
if(empno==1)
{
return "{'name':'get', 'age':'58' }";
}
return "{'name':'error', 'age':'58' }";
}
}