while (keys.hasNext()) {
String key = (String)keys.next();
NestedMarkupWriter nw = (NestedMarkupWriter)_writers.get(key);
nw.end();
if (!isScriptWriter(key))
_writer.printRaw(ScriptUtils.ensureValidScriptTags(nw.getBuffer()));
else
_writer.printRaw(nw.getBuffer());