} catch (DocumentException e) {
throw new RuntimeException(e);
}
if (sendRedirect) {
DocumentStore store = DocumentStore.instance();
id = store.newId();
ResponseWriter response = context.getResponseWriter();
response.write("<!DOCTYPE composition PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\" >");
response.startElement("html", this);
response.writeAttribute("xmlns", "http://www.w3.org/1999/xhtml", null);
response.startElement("head", this);
response.startElement("meta", this);
response.writeAttribute("http-equiv", "Refresh", null);
String viewId = Pages.getViewId(context);
baseName = baseNameForViewId(viewId);
String url = store.preferredUrlForContent(baseName, docType, id);
url = Manager.instance().encodeConversationId(url, viewId);
response.writeAttribute("content", "0; URL=" + url, null);