writer.startElement(HtmlElements.SPAN, null);
writer.writeIdAttribute(clientId + ComponentUtils.SUB_SEPARATOR + "jsf-state-container");
writer.flush();
if (!FacesContextUtils.isAjax(facesContext)) {
if (FacesVersion.supports12()) {
viewHandler.writeState(facesContext);
} else {
// catch the next written stuff into a string and look if it is empty (TOBAGO-909)
FastStringWriter buffer = new FastStringWriter(40); // usually only the marker...
TobagoResponseWriter originalWriter = (TobagoResponseWriter) facesContext.getResponseWriter();
writer = (TobagoResponseWriter) writer.cloneWithWriter(buffer);