Which of the logic tags is used for repetitive output generation?

- < logic:lessThan>
- < login:redirect>
- < logic:iterate>
- < logic:loop>

CORRECT ANSWER : < logic:iterate>

Discussion Board

logic:iterate is used for repetitive output generation as it repeats the nested body content of this tag over a specified collection. It repeats content of this tag once for every element of the specified collection, which must be an Iterator, a Collection, a Map (whose values are to be iterated over), or an array. There are following ways through which collections can be iterated:

1) As a runtime expression specified as the value of the collection attribute.
2) As a JSP bean specified by the name attribute.
3) As the property, specified by the property, of the JSP bean specified by the name attribute.


>logic:iterate id="element" name="myhashtable"<
Next element is >bean:write name="element" property="value"/<

Rohit Sharma 10-15-2014 03:32 PM

Write your comments


Enter the code shown above:
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)