@Override protected void prepIteration() throws JspTagException { try { Class<?> ipropCls = PropertyUtils.getPropertyType(bean, property); if (ipropCls.isArray()) { propArray = (Object[]) PropertyUtils.getProperty(bean, property); type = IndexOn.ARRAY; prepSizedIteration(propArray.length); } else if (Collection.class.isAssignableFrom(ipropCls)) { Collection<?> propColl = (Collection<?>) PropertyUtils.getProperty(bean, property); propList = new ArrayList<Object>(propColl); type = IndexOn.COLLECTION; prepSizedIteration(propList.size()); } else { if (toUnsetP) { to = Integer.MAX_VALUE; } else { to = Math.abs(to); } from = Math.abs(from); } } catch (Exception e) { throw new JspTagException(e); } super.prepIteration(); }
@Override public int doStartTag() throws JspException { super.doStartTag(); if (curVal == null) return Tag.SKIP_BODY; return Tag.EVAL_BODY_INCLUDE; }