おそらく、独自のイテレータを実装する必要があります。これは、bigDecimalsのリストの開始と終了を格納し、現在のイテレータを返すだけです。このようにして、無制限のサイズの数値リストを作成できます(BigDecimalsを使用しているため、これが必要なものだと思います。それ以外の場合は、intまたはlongを使用してください)。
#set ($countIterator = ${item.qtyIterator})
#foreach($i in $countIterator)
${i}
....use $i as a string...
#end
と
public class QuantityIterator implement Iterator<BigDecimal> {
QuantityIterator(BigDecimal start, BigDecimal end) { this.start = start;this.end=end;}
//..implement the iterator methods like hasNext() etc
public hasNext() {return this.current.compareTo(this.end) < 0;} //current <= end
public BigDecimal next() {
if (!hasNext()) {
throw new NoSuchElementException();
}
this.current = this.current.add(BigDecimal.ONE);
return this.current;
}
public void remove(){throw new UnsupportedException();}
}