• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

how to apply continue statement in struts logic:iterate tag

 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic