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 the role of action class in struts?

0 Answers  


What is the use of namespace in action mapping in Struts2?

0 Answers  


How does one create an action in struts 2?

0 Answers  


Why use struts framework in java?

0 Answers  


I have 4 jsp pages .At last page we have a submit button when we click it it will store all jsps data which we provide will store into database. how we can make it possible

1 Answers   MNC,


is it possible to see actionservlet in my system. if yes how

5 Answers  


What is the default suffix for Struts2 action URI and how can we change it?

0 Answers  


What is the purpose of '@keyproperty'?

0 Answers  


Why use spring, if you are already using struts?

0 Answers  


How does struts work?

0 Answers  


What’s the utilization of resource bundle properties file in struts validation structure?

0 Answers  


struts 1.3 features?

1 Answers   Integra, Zensar,


Categories