{
try
{
if(elements != null && visibleElementsId != null)
{
Slots slots = new Slots(elements, currentSlot, slotSize, slotCount);
setResultAttribute(visibleElementsId, slots.getVisibleElements());
setResultAttribute(visibleSlotsId, slots.getVisibleSlots());
setResultAttribute(lastSlotId, slots.getLastSlot());
}
else if(maxSlots > 0)
{
Slots slots = new Slots(currentSlot, slotSize, slotCount, maxSlots);
setResultAttribute(visibleSlotsId, slots.getVisibleSlots());
setResultAttribute(lastSlotId, slots.getLastSlot());
}
else
throw new JspTagException("Either elements/visibleElementsId or maxSlots must be specified.");
}
catch(Exception e)