@Override public void doTag() throws JspException { TagUtil.invokeBody(getJspBody()); } }
@Override public void doTag() throws JspException { TagUtil.invokeBody(getJspBody()); }
/** * Renders tag body to char array. */ public static char[] renderBody(final JspFragment body) throws JspException { FastCharArrayWriter writer = new FastCharArrayWriter(); invokeBody(body, writer); return writer.toCharArray(); }
@Override public void doTag() throws JspException { JspTag parent = getParent(); if (!(parent instanceof IfElseTag)) { throw new JspException("Parent IfElse tag is required", null); } IfElseTag ifTag = (IfElseTag) parent; if (!ifTag.getTestValue()) { TagUtil.invokeBody(getJspBody()); } } }
@Override public void doTag() throws JspException { JspTag parent = getParent(); if (!(parent instanceof SwitchTag)) { throw new JspException(SwitchTag.MSG_PARENT_SWITCH_REQUIRED, null); } SwitchTag switchTag = (SwitchTag) parent; if (!switchTag.isValueFounded()) { TagUtil.invokeBody(getJspBody()); } } }
@Override public void doTag() throws JspException { JspTag parent = getParent(); if (!(parent instanceof IfElseTag)) { throw new JspException("Parent IfElse tag is required", null); } IfElseTag ifTag = (IfElseTag) parent; if (ifTag.getTestValue()) { TagUtil.invokeBody(getJspBody()); } } }
@Override public void doTag() throws JspException { final PageContext pageContext = ((PageContext) getJspContext()); final HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); final UserSession userSession = UserSession.get(request); final boolean invokeBody = (userSession != null) == auth; if (invokeBody) { TagUtil.invokeBody(getJspBody()); } }
/** * Iterates collection. */ protected void iterateCollection(final Collection collection, final int from, final int count, final PageContext pageContext) throws JspException { JspFragment body = getJspBody(); Iterator iter = collection.iterator(); int i = 0; int to = calculateTo(from, count, collection.size()); while (i < to) { Object item = iter.next(); if (i >= from) { if (status != null) { iteratorStatus.next(!iter.hasNext()); } TagUtil.setScopeAttribute(var, item, scope, pageContext); TagUtil.invokeBody(body); } i++; } }
@Override public void doTag() throws JspException { boolean testValue; try { testValue = Converter.get().toBooleanValue(test, false); } catch (TypeConversionException ignore) { testValue = false; } if (testValue) { TagUtil.invokeBody(getJspBody()); } }
@Override public void doTag() throws JspException { JspTag parent = getParent(); if (!(parent instanceof SwitchTag)) { throw new JspException(SwitchTag.MSG_PARENT_SWITCH_REQUIRED, null); } SwitchTag switchTag = (SwitchTag) parent; if ((switchTag.getValue() != null) && switchTag.getValue().equals(value)) { switchTag.valueFounded(); TagUtil.invokeBody(getJspBody()); } } }
/** * Iterates arrays. */ protected void iterateArray(final Object[] array, final int from, final int count, final PageContext pageContext) throws JspException { JspFragment body = getJspBody(); int len = array.length; int to = calculateTo(from, count, len); int last = to - 1; for (int i = from; i < to; i++) { Object item = array[i]; if (status != null) { iteratorStatus.next(i == last); } TagUtil.setScopeAttribute(var, item, scope, pageContext); TagUtil.invokeBody(body); } }
/** * Loops body. */ protected void loopBody() throws JspException { JspFragment body = getJspBody(); if (body == null) { return; } LoopIterator loopIterator = new LoopIterator(start, end, step, modulus); if (status != null) { getJspContext().setAttribute(status, loopIterator); } while (loopIterator.next()) { TagUtil.invokeBody(body); } if (status != null) { getJspContext().removeAttribute(status); } } }
@Override public void doTag() throws JspException { final PageContext pageContext = ((PageContext) getJspContext()); final HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); final UserSession userSession = UserSession.get(request); final boolean invokeBody = (userSession != null) == auth; if (invokeBody) { TagUtil.invokeBody(getJspBody()); } }