@Override public void release() { beginExpression = null; endExpression = null; stepExpression = null; itemsExpression = null; super.release(); }
protected void prepare() throws JspTagException { // produce the right sort of ForEachIterator if (rawItems != null) { // extract an iterator over the 'items' we've got items = supportedTypeForEachIterator(rawItems); } else { // no 'items', so use 'begin' and 'end' items = beginEndForEachIterator(); } /* ResultSet no more supported in <c:forEach> // step must be 1 when ResultSet is passed in if (rawItems instanceof ResultSet && step != 1) throw new JspTagException( Resources.getMessage("FOREACH_STEP_NO_RESULTSET")); */ }
protected ForEachIterator toForEachIterator(String s) { StringTokenizer st = new StringTokenizer(s, ","); return toForEachIterator(st); // convert from Enumeration }
public int doStartTag() throws JspException { // evaluate any expressions we were passed, once per invocation evaluateExpressions(); // chain to the parent implementation return super.doStartTag(); }
@Override protected void prepare() throws JspTagException { // produce the right sort of ForEachIterator if (rawItems == null) { // if no items were specified, iterate from begin to end items = new ToEndIterator(end); } else if (rawItems instanceof ValueExpression) { deferredExpression = (ValueExpression) rawItems; Object o = deferredExpression.getValue(pageContext.getELContext()); Iterator iterator = toIterator(o); if (isIndexed(o)) { items = new IndexedDeferredIterator(iterator, deferredExpression); } else { items = new IteratedDeferredIterator(iterator, new IteratedExpression(deferredExpression, getDelims())); } } else { items = toIterator(rawItems); } }
public int doStartTag() throws JspException { // evaluate any expressions we were passed, once per invocation evaluateExpressions(); // chain to the parent implementation return super.doStartTag(); }
@Override protected void prepare() throws JspTagException { // produce the right sort of ForEachIterator if (rawItems == null) { // if no items were specified, iterate from begin to end items = new ToEndIterator(end); } else if (rawItems instanceof ValueExpression) { deferredExpression = (ValueExpression) rawItems; Object o = deferredExpression.getValue(pageContext.getELContext()); Iterator iterator = toIterator(o); if (isIndexed(o)) { items = new IndexedDeferredIterator(iterator, deferredExpression); } else { items = new IteratedDeferredIterator(iterator, new IteratedExpression(deferredExpression, getDelims())); } } else { items = toIterator(rawItems); } }
protected void prepare() throws JspTagException { // produce the right sort of ForEachIterator if (rawItems != null) { // If this is a deferred expression, make a note and get // the 'items' instance. if (rawItems instanceof ValueExpression) { deferredExpression = (ValueExpression) rawItems; rawItems = deferredExpression.getValue( pageContext.getELContext()); } // extract an iterator over the 'items' we've got items = supportedTypeForEachIterator(rawItems); } else { // no 'items', so use 'begin' and 'end' items = beginEndForEachIterator(); } /* ResultSet no more supported in <c:forEach> // step must be 1 when ResultSet is passed in if (rawItems instanceof ResultSet && step != 1) throw new JspTagException( Resources.getMessage("FOREACH_STEP_NO_RESULTSET")); */ }
public int doStartTag() throws JspException { // evaluate any expressions we were passed, once per invocation evaluateExpressions(); // chain to the parent implementation return super.doStartTag(); }
public void release() { super.release(); init(); }
protected ForEachIterator toForEachIterator(String s) { StringTokenizer st = new StringTokenizer(s, ","); return toForEachIterator(st); // convert from Enumeration }
protected void prepare() throws JspTagException { // produce the right sort of ForEachIterator if (rawItems != null) { // If this is a deferred expression, make a note and get // the 'items' instance. if (rawItems instanceof ValueExpression) { deferredExpression = (ValueExpression) rawItems; rawItems = deferredExpression.getValue( pageContext.getELContext()); if (rawItems == null) { // Simulate an empty list rawItems = new ArrayList(); } } // extract an iterator over the 'items' we've got items = supportedTypeForEachIterator(rawItems); } else { // no 'items', so use 'begin' and 'end' items = beginEndForEachIterator(); } /* ResultSet no more supported in <c:forEach> // step must be 1 when ResultSet is passed in if (rawItems instanceof ResultSet && step != 1) throw new JspTagException( Resources.getMessage("FOREACH_STEP_NO_RESULTSET")); */ }
public int doStartTag() throws JspException { // evaluate any expressions we were passed, once per invocation evaluateExpressions(); // chain to the parent implementation return super.doStartTag(); }
public void release() { super.release(); init(); }
protected ForEachIterator toForEachIterator(String s) { StringTokenizer st = new StringTokenizer(s, ","); return toForEachIterator(st); // convert from Enumeration }
protected void prepare() throws JspTagException { // produce the right sort of ForEachIterator if (rawItems != null) { // If this is a deferred expression, make a note and get // the 'items' instance. if (rawItems instanceof ValueExpression) { deferredExpression = (ValueExpression) rawItems; rawItems = deferredExpression.getValue( pageContext.getELContext()); if (rawItems == null) { // Simulate an empty list rawItems = new ArrayList(); } } // extract an iterator over the 'items' we've got items = supportedTypeForEachIterator(rawItems); } else { // no 'items', so use 'begin' and 'end' items = beginEndForEachIterator(); } /* ResultSet no more supported in <c:forEach> // step must be 1 when ResultSet is passed in if (rawItems instanceof ResultSet && step != 1) throw new JspTagException( Resources.getMessage("FOREACH_STEP_NO_RESULTSET")); */ }
public int doStartTag() throws JspException { // evaluate any expressions we were passed, once per invocation evaluateExpressions(); // chain to the parent implementation return super.doStartTag(); }
public void release() { super.release(); init(); }
protected ForEachIterator toForEachIterator(String s) { StringTokenizer st = new StringTokenizer(s, ","); return toForEachIterator(st); // convert from Enumeration }
protected void prepare() throws JspTagException { // produce the right sort of ForEachIterator if (rawItems != null) { // If this is a deferred expression, make a note and get // the 'items' instance. if (rawItems instanceof ValueExpression) { deferredExpression = (ValueExpression) rawItems; rawItems = deferredExpression.getValue( pageContext.getELContext()); if (rawItems == null) { // Simulate an empty list rawItems = new ArrayList(); } } // extract an iterator over the 'items' we've got items = supportedTypeForEachIterator(rawItems); } else { // no 'items', so use 'begin' and 'end' items = beginEndForEachIterator(); } /* ResultSet no more supported in <c:forEach> // step must be 1 when ResultSet is passed in if (rawItems instanceof ResultSet && step != 1) throw new JspTagException( Resources.getMessage("FOREACH_STEP_NO_RESULTSET")); */ }