Any string enclosed in the brackets remains the string until this string is parsed for OGNL expression. In the first example the string enclosed with brackets evaluated as OGNL expression that returns a list. This list is iterated and results are printed. Struts tags parse for OGNL expressions only in tag's attributes, so it doesn't parse for tag body. if you need to parse in the tag body, you can use a property
tag. So all attempts to treat a string as list failed. The iterator
tag accepts only a collection of java objects and cannot iterate a string, because a string doesn't have an iterator.
I really want to iterate over a textual representation of an array
So this is only possible if you convert a textual representation to an array. The iterator
tag can iterate over arrays.
<s:set var="testa">{6,7,8,9,10}</s:set>
<s:iterator value="%{#testa.replaceAll('[\\\{\\\}]','').split(',')}">
<!-- <s:property/> -->
</s:iterator>