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 token used for?

0 Answers  


Can you give an overview of how a struts application flows?

0 Answers  


Explain struts.devmode?

0 Answers  


What do you mean by ognl?

0 Answers  


What is role of action class?

0 Answers  






What is the purpose of @conversion?

0 Answers  


why we use struts in our web application , means what was drawbacks of servlet ...pls answer

1 Answers   IBM,


What is the differences between struts1 and struts2?

0 Answers  


What does execandwait interceptor?

0 Answers  


What is the purpose of @customvalidator annotation?

0 Answers  


What is the purpose of global-forwards tag in struct-config.xml?

0 Answers  


diffrence between dispatch action and lookupdispatch action write simple web appliction (insert records in database)

8 Answers   Symphony, TCS, Athena Health Care,






Categories