• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

iterate list issue...

 
Pradeep Adibatla
Ranch Hand
Posts: 336
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have an ArrayList in action class with a getter...

I can see the values by pringting them...Now in the UI I have an iterator for it with same name and yet it doesn't populate anything...

What could be the reason values are not populated in UI....



Action class...
---------------------



in JSP:
---------




this is what is present in rendered HTML...



Is there a problem with the above one??
 
Lorand Komaromi
Ranch Hand
Posts: 276
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This should suffice because the current object is on the top of the value stack:

 
Pradeep Adibatla
Ranch Hand
Posts: 336
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nope... Makes no change! Struggling for days now wonder what could be ?
 
Lorand Komaromi
Ranch Hand
Posts: 276
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show me the action's mapping from struts.xml? You're not accessing the .jsp directly in the browser, right..?
 
Pradeep Adibatla
Ranch Hand
Posts: 336
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No Iamn't !

Here it is... The mapping is fine I suppose...

 
Lorand Komaromi
Ranch Hand
Posts: 276
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you post the code of the getter method..?
 
Pradeep Adibatla
Ranch Hand
Posts: 336
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator





This is the actual ArrayList....


with simple the getter isn't called but for the index(intially posted) one it is getting called twice...

The variable X was to keep track of getter method !!!

I can see the values in the console properly getting displayed but not in the UI...
 
Lorand Komaromi
Ranch Hand
Posts: 276
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a getter for myList?
 
Pradeep Adibatla
Ranch Hand
Posts: 336
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ohh ! wrongun... this is the one...




 
Lorand Komaromi
Ranch Hand
Posts: 276
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does your URL look like when you open the page in the browser?
 
Pradeep Adibatla
Ranch Hand
Posts: 336
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is it ....





 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic