Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


i have list of values(e.g 100).
using logic:iterate, how can i print the multiples of 5th
element?
how the logic:iterate will understand the multiples of 5.

Answers were Sorted based on User's Feedback



i have list of values(e.g 100). using logic:iterate, how can i print the multiples of 5th elemen..

Answer / murali krishna yella

ya.. this will surely work fine

<logic:iterate id="item" name="listName" scope="request"
indexId="index">
<%
if( (index%5)==0 ){
<bean:write name="item"/>
}
%>
</logic:iterate>

Is This Answer Correct ?    22 Yes 2 No

i have list of values(e.g 100). using logic:iterate, how can i print the multiples of 5th elemen..

Answer / sharmila

You can try "indexId" param in the logic:iterate

It will give us the index value. So, inside the loop, you
can check if index value is multiple of 5 then only show the
record from the bean.

Is This Answer Correct ?    6 Yes 5 No

Post New Answer

More Struts Interview Questions

Difference between ActionErrors and ActionMessage?

1 Answers   iGate,


Can we have multiple struts config files in a single web app?

0 Answers  


What are the steps involved in creating a strut application?

0 Answers  


What is the use of resourcebundle.properties file in Struts Validation framework?

0 Answers  


whats is mean Actionerrors and Actionerror?

5 Answers   Wipro,


how you implement and maintain your struts project by using MVC2 arch?

2 Answers   Patni, Wipro,


What is the purpose of action tag in struts.xml?

0 Answers  


1.can we transfer a request from one struts application to another struts application? 2. how many types of action servlets r there what r they

0 Answers   TCS,


How do I access token?

0 Answers  


How do you create message resource?

0 Answers  


Name some useful annotations introduced in Struts2?

0 Answers  


What is Struts Flow?

17 Answers   CTS, rsystems,


Categories