use of org.apache.struts2.util.SubsetIteratorFilter in project entando-core by entando.
the class AdminPagerTag method doStartTag.
@Override
public int doStartTag() throws JspException {
Object source = this.findValue(this.getSource());
ServletRequest request = this.pageContext.getRequest();
ValueStack stack = this.getStack();
ComponentPagerVO compPagerVo = new ComponentPagerVO(stack);
try {
AdminPagerTagHelper helper = this.getPagerHelper();
IPagerVO pagerVo = helper.getPagerVO((Collection) source, this.getPagerId(), this.getCount(), this.isAdvanced(), this.getOffset(), request);
compPagerVo.initPager(pagerVo);
stack.getContext().put(this.getObjectName(), compPagerVo);
stack.setValue("#attr['" + this.getObjectName() + "']", compPagerVo, false);
} catch (Throwable t) {
_logger.error("Error creating the pager", t);
// ApsSystemUtils.logThrowable(t, this, "doStartTag");
throw new JspException("Error creating the pager", t);
}
SubsetIteratorFilter subsetIteratorFilter = new SubsetIteratorFilter();
subsetIteratorFilter.setCount(this.getCount());
subsetIteratorFilter.setDecider(null);
subsetIteratorFilter.setSource(source);
subsetIteratorFilter.setStart(compPagerVo.getBegin());
subsetIteratorFilter.execute();
this.setSubsetIteratorFilter(subsetIteratorFilter);
this.getStack().push(subsetIteratorFilter);
if (getId() != null) {
pageContext.setAttribute(getId(), subsetIteratorFilter);
}
return EVAL_BODY_INCLUDE;
}
Aggregations