aspose file tools*
The moose likes Struts and the fly likes How to break from the struts logic:iterate tag ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to break from the struts logic:iterate tag ?" Watch "How to break from the struts logic:iterate tag ?" New topic
Author

How to break from the struts logic:iterate tag ?

pratibha patel
Greenhorn

Joined: Feb 22, 2007
Posts: 19
Hello All,

In JSP I am using logic:iterate tag to iterate my collection. In scriptlet I have if and else statements, when certain condition met, I want to break form the loop.
something like this example:

Now I want to break after else conditon from iterate loop. So if I put break, it throws an exception says Code is unreachable.
Example->

Is there any way to break from iterate tag ?

Please do the needful.
Thanks.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61221
    
  66

Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
getshijos joseph
Greenhorn

Joined: May 28, 2010
Posts: 5
As far as I know , struts doesn't support break from iterate. It expects a collection to be populated by Action class and view will only render the prepopulated collection. All those logic to filter the collection should be done within the action class.


admin
www.javarecharge.com
||||||||||||||................
Wanna recharge
Karthik Jayachandran
Ranch Hand

Joined: Feb 18, 2009
Posts: 88


You can use logic:equal/logic:notEqual tags inside logic:iterate tag
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to break from the struts logic:iterate tag ?