Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing dynamic values in the value attribute of ITERATOR

 
Rajaprabhu Aravindasamy
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys...!

I am having a problem with assigning dynamic values with value attribute of ITERATOR..!
My problem is..,

I had added some details into an array of arraylist in action class.[ ArrayList[] arr=new ArrayList[cnt] ...... arr[i].add(somebean)]
So in the arraylist 'arr', each cell is containing an arraylist i.e) group of objects.
And i had written a getter in the action class.[ public ArrayList[] getDetails(){ .... } ]

My question is..,
how can i access that array of arraylist in jsp with ITERATOR..?
Is there any way to pass dynamic values(0,1,..n) to the value attribute in ITERATOR..?

please refer the following code to analyse my scenario..!

(display-> dto objecj.
arr-> array of arraylists.)



i want to change the value in the place of question mark dynamically..! please help..!
alternative ways will also be appreciated..!
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please refer the following link HowToUseIterator
 
Rajaprabhu Aravindasamy
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai.., Mohan Rao...

I know how to use iterator...! Please read my post fully and then reply for that..!
I am seeking a solution to pass array of arraylist into the value attribute..!
or pass dynamic values to the value attribute in iterator..!

The following code is working, if i set the array index as 0 but i need to pass the dynamic values from the loop (0,1..n)...,

<% for(some condition)
{ %>
<s:iterator value="display.arr[0]">
.
.
</s:iterator>

<% } %>

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic