How to invoke a servlet in AEM? Suggest me steps , methods or process if any.
Solved! Go to Solution.
Check this, it covers all possible ways
http://www.aemcq5tutorials.com/tutorials/sling-servlet-in-aem/
Check this, it covers all possible ways
http://www.aemcq5tutorials.com/tutorials/sling-servlet-in-aem/
Generally, you can call servlet different ways
You can call it using AJAX request, which normally you use to load the content without refreshing entire page
$("button").click(function(){
$.ajax({url: "/bin/servlet", success: function(result){
$("#div1").html(result);
}});
});
You can also use HTML form action to call servlet
<form action="/bin/servlet" method="get">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="submit" value="Submit">
</form>
In AEM most of the time, we use AJAX approach and populating dialog fields which are step 1 and 4
Views
Replies
Total Likes