if (extendedResponse.getContentType() != null && isValidContentType(extendedResponse.getContentType()))
{
addResource.parseResponse(extendedRequest, extendedResponse.toString(),
servletResponse);
addResource.writeMyFacesJavascriptBeforeBodyEnd(extendedRequest,
servletResponse);
if( ! addResource.hasHeaderBeginInfos() ){
// writes the response if no header info is needed
addResource.writeResponse(extendedRequest, servletResponse);