//}
// note that we cannot use this.getPartialResponseWriter(), because
// this could cause problems if PartialResponseWriter is wrapped
PartialResponseWriter writer = _facesContext.getPartialViewContext().getPartialResponseWriter();
PartialViewContext pvc = _facesContext.getPartialViewContext();
ResponseWriter oldWriter = _facesContext.getResponseWriter();
boolean inDocument = false;
//response type = text/xml
//no caching and no timeout if possible!
ExternalContext externalContext = _facesContext.getExternalContext();
externalContext.setResponseContentType("text/xml");
externalContext.addResponseHeader("Pragma", "no-cache");
externalContext.addResponseHeader("Cache-control", "no-cache");
//under normal circumstances pragma should be enough, IE needs
//a special treatment!
//http://support.microsoft.com/kb/234067
externalContext.addResponseHeader("Expires", "-1");
try
{
writer.startDocument();
inDocument = true;
_facesContext.setResponseWriter(writer);
if (pvc.isRenderAll())
{
processRenderAll(viewRoot, writer);
}
else
{
Collection<String> renderIds = pvc.getRenderIds();
//Only apply partial visit if we have ids to traverse
if (renderIds != null && !renderIds.isEmpty())
{
Set<VisitHint> hints = new HashSet<VisitHint>();
// unrendered have to be skipped, transient definitely must be added to our list!