Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

Can I use custom sling servlets in my AEM applications

Avatar

Level 10

Can I make use of custom sling servlets in my AEM applications? 

1 Accepted Solution

Avatar

Correct answer by
Level 10

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.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

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.