Solved

Implementing a for circle with Struts custom tag

Posted on 2004-04-29
3
459 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
base64 decode encode 12 161
How to only allow authenticated (logged in) users to access Spring restful service 3 91
couple of eclipse 5 52
Code Coverage and Coding Standards 2 43
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 last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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.

740 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