Hi Clive Stewart
As pointed correctly by Awadesh, you should either change method to “GET” or implement your logic in “doPost” method.
Please have a look at the article link: - https://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html
-------------------------------
Brief about this article
-------------------------------
This article covers Submitting Adobe CQ form data to java Sling Servlets using POST method.
So Basically here we are doing AJAX POSTrequest :-
$.ajax({
type: 'POST',
url:'/bin/mySearchServlet',
data:'id='+ claimId+'&firstName='+ myFirst+'&lastName='+ myLast+'&address='+ address+'&cat='+ cat+'&state='+ state+'&details='+ details+'&date='+ date+'&city='+ city,
success: function(msg){
alert(msg); //display the data returned by the servlet
}
});
And OSGI java code is handling it by:-
protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServerException, IOException {
<Code Logic>
}
I hope this will solve your problem.
Thanks and Regards
Kautuk Sahni