Can I use custom sling servlets in my AEM applications | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

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

//Use JQuery AJAX request to post data to a Sling Servlet

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

For details, see http://scottsdigitalcommunity.blogspot.ca/2013/06/posting-form-data-to-adobe-cq-using.html.

1 reply

smacdonald2008
smacdonald2008AuthorAccepted solution
Level 10
October 16, 2015

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

//Use JQuery AJAX request to post data to a Sling Servlet

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

For details, see http://scottsdigitalcommunity.blogspot.ca/2013/06/posting-form-data-to-adobe-cq-using.html.