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

what is a RequestProcessor?

5 Answers   TCS, Wipro,


what is the difference between SAX Parser and DOM Parser??

14 Answers   Cap Gemini, Goldman Sachs, HCL, Hidden Brains, HP,


What is the difference between struts and spring?

0 Answers  


What is the purpose of struct-config.xml in struct2?

0 Answers  


how many methods are there in RequestPrccesor class?

2 Answers   Infosys,


How can we display all validation errors to user on jsp page?

0 Answers  


Where can I get help with struts?

0 Answers  


What is the default suffix for struts2 action uri ?

0 Answers  


What is the purpose of action-mappings tag in struct-config.xml?

0 Answers  


where you use thread in your java project?

1 Answers   Cap Gemini,


Provide some important Struts2 constants that you have used?

0 Answers  


what is the difference between ServletContext and ServletConfig?

4 Answers  


Categories