AEM inserts html info comment into json
I have the following jsp
<% JSONObject jsonResult = new JSONObject(); response.setContentType("application/json"); String parentNodePath = slingRequest.getRequestPathInfo().getResourcePath(); String url = getServerBaseUrl(sling) + parentNodePath.split("/jcr:content")[0] + ".html?cid=twitter"; UrlShortener urlShortener = sling.getService(UrlShortener.class); String shortUrl = urlShortener.shorten(url); String encShortUrl = URLEncoder.encode(shortUrl); jsonResult.put("url", url); jsonResult.put("shortUrl", shortUrl); jsonResult.put("encShortUrl", encShortUrl); %> <%=jsonResult.toString()%>
It executed when I type in browser the following adresshttp://servername:port/path/to/page.urlshortener.html.jsp
As you see i have "application/json" contentType. Result must contain only json information, but there is html comment:
{ "url":"http://servername/content/betcom/test/test1/naps1.html?cid=twitter", "shortUrl":"http://servername/1E4sZYJ", "encShortUrl":"http%3A%2F%2Fservername%2F1E4sZYJ" } <!--cq{"decorated":false,"type":"app/components/page/newsarticlepage","path":"/content/app/test/test1/naps1/jcr:content","selectors":"urlshortener","servlet":script/apps/app/components/page/contentpage/urlshortener.html.jsp","totalTime":276,"selfTime":276}-->Also i saw, this comments inserted after every component, or executed jsp in any page. How to turn off insertion of this comment?