What Can Be Done?

There is a structural supposition within CQ that the output of JSP pages will be HMTL. Because of that, <div> tags are generated for sections of content automatically. Writing these <div> tags causes writes to the output buffer that should not happen. Even if writing to the output buffer did not cause the exception, it would create bad Atom files with <div> tags sprinkled throughout in places they should not be. Changes need to be made to the JSP pages that handle the *.feed suffix. Those files can be found here:

Within ALL feed oriented JSP files (*.feed.jsp, *.feedentry.jsp, etc) the following must be added:

// This bypasses the normal component handling with its automatic output of content
request.setAttribute(ComponentContext.BYPASS_COMPONENT_HANDLING_ON_INCLUDE_ATTRIBUTE, "true");
// This changes the tag used for blocking areas of content from "div" to "".
// When empty, a tag will not be written to create blocks of content.
IncludeOptions.getOptions(request,true).setDecorationTagName("");

These nodes are part of the foundation components for CQ. Make backups. And be aware that these components can be overwritten without warning in future updates. You will need to document well the changes that have been made in case problems arise later.

Legal

The views expressed in this blog are my own and do not necessarily reflect the views of Adobe Systems Incorporated. Really.