Hi @Sanjay_Bangar ,
When doing a ajax call use something like below
var square = {};
square.length = 10;
square.width = 10;
$.ajax(
url: url,
data: JSON.stringify(square),
dataType: “json”
contentType: “application/json”,
);
while reading in servlet you can use like below:
String requestBody = request.getReader().lines().collect(Collectirs.joining());
you can use any Utils class to convert from string to json or java bean.
Thanks!