本文整理汇总了Java中javax.servlet.jsp.tagext.BodyContent.writeOut方法的典型用法代码示例。如果您正苦于以下问题:Java BodyContent.writeOut方法的具体用法?Java BodyContent.writeOut怎么用?Java BodyContent.writeOut使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.servlet.jsp.tagext.BodyContent
的用法示例。
在下文中一共展示了BodyContent.writeOut方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: flushBufferedBodyContent
import javax.servlet.jsp.tagext.BodyContent; //导入方法依赖的package包/类
/**
* The user customised the output of the error messages - flush the
* buffered content into the main {@link javax.servlet.jsp.JspWriter}.
*/
protected void flushBufferedBodyContent(BodyContent bodyContent) throws JspException {
try {
bodyContent.writeOut(bodyContent.getEnclosingWriter());
}
catch (IOException e) {
throw new JspException("Unable to write buffered body content.", e);
}
}
示例2: doEndTag
import javax.servlet.jsp.tagext.BodyContent; //导入方法依赖的package包/类
@Override
public int doEndTag() throws JspException {
BodyContent bc = getBodyContent();
if (bc != null) {
try {
NormalizeWhitespaceWriter nww = new NormalizeWhitespaceWriter(getBodyContent().getEnclosingWriter());
bc.writeOut(nww);
// make sure orphaned whitespace is flushed
nww.done();
} catch (IOException e) {
throw new JspException(e);
}
}
return EVAL_PAGE;
}
示例3: doAfterBody
import javax.servlet.jsp.tagext.BodyContent; //导入方法依赖的package包/类
public int doAfterBody() throws JspTagException {
BodyContent body = getBodyContent();
try {
JspWriter out = getPreviousOut();
out.write("<title>");
body.writeOut(out);
out.write("</title>");
} catch (IOException e) {
throw new JspTagException(e.getMessage());
}
body.clearBody();
return SKIP_BODY;
}
示例4: doAfterBody
import javax.servlet.jsp.tagext.BodyContent; //导入方法依赖的package包/类
public int doAfterBody() throws JspTagException {
BodyContent body = getBodyContent();
try {
body.writeOut(getPreviousOut());
} catch (IOException e) {
throw new JspTagException(e.getMessage());
}
body.clearBody();
return SKIP_BODY;
}
示例5: doAfterBody
import javax.servlet.jsp.tagext.BodyContent; //导入方法依赖的package包/类
public int doAfterBody() throws JspTagException {
BodyContent body = getBodyContent();
try {
Writer out = getPreviousOut();
out.write("<");
out.write(elm);
Enumeration<String> enum1 = vecAttrNames.elements();
Enumeration<String> enum2 = vecAttrValues.elements();
for (; enum1.hasMoreElements() && enum2.hasMoreElements();) {
out.write(" ");
out.write(enum1.nextElement());
out.write("=\"");
out.write(enum2.nextElement());
out.write("\"");
}
out.write(">");
body.writeOut(out);
out.write("</");
out.write(elm);
out.write(">");
} catch (IOException e) {
throw new JspTagException(e.getMessage());
}
body.clearBody();
vecAttrNames.clear();
vecAttrValues.clear();
return SKIP_BODY;
}
示例6: writeTagBodyContent
import javax.servlet.jsp.tagext.BodyContent; //导入方法依赖的package包/类
/**
* Wrapper the body with the folding section if applicable
*/
public void writeTagBodyContent(JspWriter out, BodyContent bodyContent) throws IOException {
if (log.isDebugEnabled())
log.debug(this.NAME+".otherDoEndTagOperations(): containsContent=" + m_containsContent+", hideIfNoWidgets = "+m_hideIfNoWidgets);
// test to see if anything should be displayed:
if (m_containsContent || (m_hideIfNoWidgets == false)) {
// Write out the first part of the folding section
StringBuffer sb = new StringBuffer();
sb.append("<table class='foldingSectionOuter' width='100%' border='0' cellspacing='0' cellpadding='0' >\n")
.append(" <tbody>")
.append(" <tr>\n")
.append(" <td colspan='3' >\n")
.append(" <table class='foldingSectionInner' width='100%' border='0' cellspacing='0' cellpadding='0'>\n")
.append(" <tbody>")
.append(" <tr>\n")
.append(" <td class='sectionheader' colSpan=4 valign='bottom' width='100%'>\n")
.append(" <table width='100%'>\n")
.append(" <tr>\n")
.append(" <td class='sectiontitle'>").append(getName()).append((getKey() != null ? TagHelper.getLabelEditorLink(pageContext, getKey()) : "")).append("</td>\n")
.append(" <td align='right'><a id='").append(getId()).append("section' name=" + getId() + "section href=\"javascript:expand('").append(getId()).append("' , '").append(getId()).append("Expand')\"><img src='").append(MINIMISE).append("' border='0' name='").append(getId()).append("Expand'></a></td>\n")
.append(" </tr>\n")
.append(" </table>\n")
.append(" </td>\n")
.append(" </tr>\n")
.append(" <tr class='foldingsectionleft'>\n")
.append(" <td colspan='3' class='foldingsectionpad'>\n")
.append(" <span id='").append(getId()).append("' name=\"").append(StringHelper.convertToHTML(getName())).append("\" style='display:block' class='WidgetFoldingSection'>\n")
.append(" <table class='outer' cellspacing='0' cellpadding='0' width='100%'>\n")
.append(" <tr>\n")
.append(" <td>\n");
// NOTE: The StringHelper.convertToHTML() routine escapes doubles-quotes, but not single-quotes. Hence we've used double-quotes around the 'name' attribute of the <span> tag above
// Write the header stuff
out.print(sb.toString());
if (log.isDebugEnabled())
log.debug(this.NAME+".doAfterBody: Write out top part");
// write the body content (after processing by the JSP engine) on the output Writer
bodyContent.writeOut(out);
if (log.isDebugEnabled())
log.debug(this.NAME+".doAfterBody: Write Body = ...\n" + bodyContent.getString());
// Write out the closing part of the folding section
sb = new StringBuffer();
sb.append(" </td>\n")
.append(" </tr>\n")
.append(" </table>\n")
.append(" </span>\n")
.append(" </td>\n")
.append(" </tr>\n")
.append(" </tbody>\n")
.append(" </table>\n")
.append(" </td>\n")
.append(" </tr>\n")
.append(" </tbody>\n")
.append("</table>\n")
.append("<script>\nfoldingSectionList.push(document.getElementById('")
.append(getId())
.append("'));\n");
if (getClosed()) {
sb.append("initialExpand('").append(getId()).append("' , '").append(getId()).append("Expand');\n");
} else {
sb.append("setDefaultState('").append(getId()).append("' , '").append(getId()).append("Expand');\n");
}
sb.append("</script>\n");
//@TODO - need to keep track of the state using cookies?
//sb.append("<script>SetDefaultState('" + getId() + "');</script>");
out.print(sb.toString());
} else {
log.debug("FoldingSection contents suppressed as it has no visible registered widgets. Body was=\n" + bodyContent.getString());
}
// clear the body content for the next time through.
bodyContent.clearBody();
}
示例7: writeTagBodyContent
import javax.servlet.jsp.tagext.BodyContent; //导入方法依赖的package包/类
private void writeTagBodyContent(JspWriter out, BodyContent bodyContent) throws IOException {
bodyContent.writeOut(out);
bodyContent.clearBody();
}
示例8: writeTagBodyContent
import javax.servlet.jsp.tagext.BodyContent; //导入方法依赖的package包/类
/**
* Fill in this method to process the body content of the tag.
* You only need to do this if the tag's BodyContent property
* is set to "JSP" or "tagdependent."
* If the tag's bodyContent is set to "empty," then this method
* will not be called.
* @param out wirter for context
* @param bodyContent current body content
* @throws IOException if any unpredicted IO errors occur
*/
public void writeTagBodyContent(JspWriter out, BodyContent bodyContent) throws IOException {
//
// write the body content (after processing by the JSP engine) on the output Writer
//
bodyContent.writeOut(out);
// clear the body content for the next time through.
bodyContent.clearBody();
}
示例9: writeTagBodyContent
import javax.servlet.jsp.tagext.BodyContent; //导入方法依赖的package包/类
/**
* Fill in this method to process the body content of the tag.
* You only need to do this if the tag's BodyContent property
* is set to "JSP" or "tagdependent."
* If the tag's bodyContent is set to "empty," then this method
* will not be called.
*/
public void writeTagBodyContent(JspWriter out, BodyContent bodyContent) throws IOException {
// write the body content (after processing by the JSP engine) on the output Writer
bodyContent.writeOut(out);
// clear the body content for the next time through.
bodyContent.clearBody();
}