本文整理匯總了Java中javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE屬性的典型用法代碼示例。如果您正苦於以下問題:Java Tag.EVAL_BODY_INCLUDE屬性的具體用法?Java Tag.EVAL_BODY_INCLUDE怎麽用?Java Tag.EVAL_BODY_INCLUDE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類javax.servlet.jsp.tagext.Tag
的用法示例。
在下文中一共展示了Tag.EVAL_BODY_INCLUDE屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: renderTag
@Override
public String renderTag(TagSupport tag, PageContext pageContext, String body) throws Exception {
StringWriter strWriter = new StringWriter();
HttpServletResponse response = mock(HttpServletResponse.class);
when(response.getWriter()).thenReturn(new PrintWriter(strWriter, true));
if (!mockingDetails(pageContext).isSpy()) {
pageContext = spy(pageContext);
}
JspWriter jspWriter = new JspWriterImpl(response);
doReturn(jspWriter).when(pageContext).getOut();
tag.setPageContext(pageContext);
if (Tag.EVAL_BODY_INCLUDE == tag.doStartTag()) {
jspWriter.flush();
strWriter.write(body);
}
jspWriter.flush();
tag.doEndTag();
jspWriter.flush();
tag.release();
return strWriter.toString();
}
示例2: doStartTag
public int doStartTag() throws JspException {
boolean authorized = getPermissionChecker().isAuthorized(permission);
if (!authorized) {
return Tag.SKIP_BODY;
}
return Tag.EVAL_BODY_INCLUDE;
}
示例3: doStartTag
public int doStartTag() {
if (!isAccessible()) {
return Tag.SKIP_BODY;
} else {
return Tag.EVAL_BODY_INCLUDE;
}
}