Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to apply continue statement in struts logic:iterate tag

 
Khushwinder Chahal
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends

Does anybody has any idea to apply continue statement in struts <logic:iterate> tag.
I need it in my application.

Thank You In Advance.
 
Ranjit Gopinathan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming that the "continue" is used in conjunction with a comparison

<logic:iterate>
<logic:equal>
This part will only be executed if the condition is true
</logic:equal>
else it will continue.
</logic:iterate>

You may use a logic tag ( equal, notequal, present ..) for the comparison.
Will this serve the purpose??
[ October 25, 2007: Message edited by: Ranjit Gopinathan ]
 
Khushwinder Chahal
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks For Reply Sir

But i think i need to explain my problem a little bit more.
Actually i am using nested <logic:iterate>.
Now what i want is that when the inner loop prints some value it should break it and continue with the next outer loop.
Here loops means logic iterate.
So what i should do now.
I need it very urgently.
Please help me.
 
Ranjit Gopinathan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post the code. That way it will be easy for us to find the solution.

And call me Ranjit

Cheers
 
Khushwinder Chahal
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay Ranjit
Here is my code


I need to shift to outer loop when one of the conditions between logic equal or logic not equal occurs.
 
Ranjit Gopinathan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If i understand the logic correctly , the second array list ( inner one ) need to be iterated only once, whatever be its size.Because equal or not equal the flow must exit that inner list.

In that case, instead of the array list, a simple bean can be used right?

Or else write a method in action form which will return the first object of the array List. get that bean and process it.
 
Dom Lassy
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should do all of that logic in your action class. It is a lot easier to do there and it is a lot easier to maintain.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic