Solved

Implementing a for circle with Struts custom tag

Posted on 2004-04-29
3
458 Views
Last Modified: 2013-11-24
Is possibile implement a circle For with Struts custom tag Or I must use the JSTL core library?

Thanks
0
Comment
Question by:MissBrucoMela
  • 2
3 Comments
 
LVL 7

Expert Comment

by:searlas
ID: 10948940
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:
http://jakarta.apache.org/struts/userGuide/struts-logic.html#iterate
0
 

Author Comment

by:MissBrucoMela
ID: 10949074
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?
0
 
LVL 7

Accepted Solution

by:
searlas earned 125 total points
ID: 10949179
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}"/>
</c:forEach>


0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
eclipse java  build path 6 64
tomcat not starting 6 68
servlet filter example 37 71
eclipse buid path vs tomcat lib path 10 34
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question