Make AEM page return JSON data
[Thread Edited By Adobe]
/*Don’t forget to meet and greet your fellow peers virtually by telling them about yourself here.
Go ahead and to it now: https://adobe.ly/3eDnB4v */
Actual Post:
hi Everyone,
My requirement is to do some business logic ((this can be only done in client side otherwise i could have written bundles)) in the javascript/jquery and take the output from that script and set that as page response in JSON format. Setting the AEM page response as JSON is the challenge.
I have tried using scriptlets like <%@ page contentType="application/json" %> and <%@ page language="java" contentType="application/json; charset=UTF-8" pageEncoding="UTF-8"%>. But along with JSON it prints HTML also.
We want AEM page to return only JSON not any HTML. Any suggestions please ??


