Skip to main content
Level 3
Oct 16, 2015 2:28 AM UTC
Solved

Extra markup in servlet response

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
joerghoh
joerghohAccepted solution
Adobe Employee
Oct 16, 2015 2:28 AM UTC

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

2 replies

Level 3
Oct 16, 2015 2:28 AM UTC

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

Translate
joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
Oct 16, 2015 2:28 AM UTC

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

Translate