in src/main/java/org/apache/sling/servlets/get/impl/helpers/HtmlRenderer.java [46:83]
public void render(final SlingHttpServletRequest req,
final SlingHttpServletResponse resp) throws IOException {
final Resource r = req.getResource();
if (ResourceUtil.isNonExistingResource(r)) {
throw new ResourceNotFoundException("No data to render.");
}
resp.setContentType(req.getResponseContentType());
resp.setCharacterEncoding("UTF-8");
final PrintWriter pw = resp.getWriter();
final boolean isIncluded = req.getAttribute(SlingConstants.ATTR_REQUEST_SERVLET) != null;
@SuppressWarnings({ "rawtypes" })
final Map map = r.adaptTo(Map.class);
if ( map != null ) {
printProlog(pw, isIncluded);
printResourceInfo(pw, r);
render(pw, r, map);
printEpilog(pw, isIncluded);
} else if ( r.adaptTo(String.class) != null ) {
printProlog(pw, isIncluded);
printResourceInfo(pw, r);
render(pw, r, r.adaptTo(String.class));
printEpilog(pw, isIncluded);
} else if ( r.adaptTo(String[].class) != null ) {
printProlog(pw, isIncluded);
printResourceInfo(pw, r);
render(pw, r, r.adaptTo(String[].class));
printEpilog(pw, isIncluded);
} else {
if ( !isIncluded ) {
resp.setStatus(HttpServletResponse.SC_NO_CONTENT); // NO Content
}
}
}