本文整理汇总了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;
}
}