Solved

Implementing a for circle with Struts custom tag

Posted on 2004-04-29
3
455 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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.

707 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now