• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 464
  • Last Modified:

Implementing a for circle with Struts custom tag

Is possibile implement a circle For with Struts custom tag Or I must use the JSTL core library?

  • 2
1 Solution
Do you want to do the equivalent of for (int i =0; i < 10; i++) { ... }
Or, are you trying to iterate over a collection/array?

If you actually have something to iterate over, use the logic:iterate tag:
MissBrucoMelaAuthor Commented:
I want to do something like :

for (int i =0; i < 10; i++) { ... }
and not use logic: iterate tag. Is it possible? If not possibile, how can I do this using the Iterate tag?
No, Struts doesn't support this.  Struts tags always involve a resource of some kind (bean/parameter/message/cookie), they do not attempt to encapsulate logic such as independent for loops.

JSTL would be the appropriate solution.

From the spec:

<c:forEach var="i" begin="0" end="10">
<c:out value="${i}"/>

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now