Expand my Community achievements bar.

SOLVED

Extra markup in servlet response

Avatar

Level 4

I have a page component, which includes a JSP called getString.jsp that's intended to be called via Ajax, like domain.com/path/path/page.getString.html. This was working fine in CQ 5.4 - when I call that URL, I get a simple string value. When I upgraded to AEM 6.1, I started getting the correct string, but with an HTML comment similar to this after it

<!--cq{"decorated":false,"type":"client/project/components/page/inuitGridContentPage","path":"/content/path/en_US/pages/home/jcr:content","selectors":"selectorName","servlet":"servletClass","totalTime":1,"selfTime":1}-->

I tried migrating that functionality to a servlet in my OSGi bundle instead of a small JSP, but the result is the same (that HTML comment above actually comes from this test).

The strange thing is that I have a different servlet doing a similar thing which does not append a similar comment. Does anyone know where this is coming from?

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

HI

IIRC this is injected by some filter (WCMDebugFilter?). It's quite likely that it deoendes on the extension of your request (in your case ".html"). If you change to something else (for example ".json") it will go away.

kind regards,
Jörg

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

HI

IIRC this is injected by some filter (WCMDebugFilter?). It's quite likely that it deoendes on the extension of your request (in your case ".html"). If you change to something else (for example ".json") it will go away.

kind regards,
Jörg

Avatar

Level 4

Thanks. I ended up using .xml - .json gave me an error in the DefaultGetServlet, I think it was.