Unable to call SlingAllMethodsServlet servlet in AEM 6.4
Hello friends
I have created a component which has few field in it and on the press of submit button i am calling ajax defined below :
$.ajax({
type: 'GET',
url:'/htlSearchServlet',
data:'id='+ claimId+'&firstName='+ myFirst+'&lastName='+ myLast+'&address='+ address+'&cat='+ cat+'&state='+ state+'&details='+ details+'&date='+ date+'&city='+ city,
success: function(msg){
var json = jQuery.parseJSON(msg);
var msgId= json.id;
var lastName = json.lastname;
var firstName = json.firstname;
$('#ClaimNum').val(msgId);
$('#json').val("Filed by " + firstName + " " + lastName);
}
});
and trying to call my servlet to handle these fields , below is the code for how i have defined my servlet to handle this request
@8220494(service=Servlet.class,
property={
Constants.SERVICE_DESCRIPTION + "=Simple Demo Servlet",
"sling.servlet.methods=" + HttpConstants.METHOD_GET,
"sling.servlet.resourceTypes="+ "/htlSearchServlet",
"sling.servlet.extensions=" + "txt"
})
/*"sling.servlet.resourceTypes="+ "appfoldername/components/structure/page",
* "sling.servlet.extensions=" + "txt",*/
public class SimpleServlet extends SlingAllMethodsServlet {
//code of Get request comes here
}
but don't know whats wrong i am doing, it is giving 404 not found error, when i checked in browser console using chrome browser.
Thanks in advance
Yash