externalContext.setResponseContentType("text/xml");
writer.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
writer.startElement("partial-response", null);
writer.startElement("redirect", null);
writer.writeAttribute("url", url, null);
writer.endElement("redirect");
writer.endElement("partial-response");
}
else {
context.getExternalContext().redirect(url);