return template;
}
@Override
public String content() throws AppException {
TagWriter writer = null;
try {
writer = new TagWriter(new CharArrayWriter());
Form form = parser.getForm();
ContainHTMLElementTag topElement = null;
if ((form != null && !(parser.getGroup() instanceof Group.DEFAULT) && !form.id().equals(Form.__DEFAULT_FORM_NAME)) || parser.getGroup() instanceof Group.DEFAULT) {
// 生成form标签
FormElementTag formElement = new FormElementTag();
formElement.setAction(form.action());
formElement.setEnctype(form.enctype());
formElement.setMethod(form.method().name());
formElement.setId(form.id());
formElement.setCssClass(form.cssClass());
topElement = formElement;
} else {
DivElementTag divElement = new DivElementTag(_TOP_CONTAINER);
topElement = divElement;
}
this.parserComponents(topElement);
topElement.doTag(writer);
return writer.getWritedString();
} catch (JspException ex) {
Logger.getLogger(ContentTemplate.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(ContentTemplate.class.getName()).log(Level.SEVERE, null, ex);
} finally {
if (writer != null) {
writer.close();
}
}
return null;
}