April 7, 2020
Estimated Post Reading Time ~

How to use Custom sling servlets in AEM applications

Question: How can I use Custom create sling servlets in AEM Applications?

Answer: You can create custom sling servlets using Maven and deploy the servlet to Adobe CQ. Once deployed, you can use AJAX to post data to the sling servlet. 


For example:
$.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
 }
});

Adobe Complete Article: http://helpx.adobe.com/adobe-cq/using/custom-sling-servlets.html


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.