aspose file tools*
The moose likes Struts and the fly likes iterate problem in struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "iterate problem in struts2" Watch "iterate problem in struts2" New topic
Author

iterate problem in struts2

Hrishikesh Maluskar
Ranch Hand

Joined: Jun 19, 2008
Posts: 115
i am not able to iterate myList. Its not showing any value in struts2.



Nothing is getting displayed on line 99.







SCJP 1.5
www.licexpadvice.com
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please include only relevant sections of code and configuration; extraneous information just clouds the issue.

"myList" is not exposed through the action, hence is not available in the JSP.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Also, while it's very difficult to read and discover, your HTML is malformed.
Hrishikesh Maluskar
Ranch Hand

Joined: Jun 19, 2008
Posts: 115
struts.xml entry is as follows. How to expose myList through action.



SearchFlats.jsp


Traverse.java


User.java
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9305
    
  17

Hrishikesh Maluskar wrote:How to expose myList through action

Create a getter method for myList in your Traverse class i.e. add this method to your Traverse class


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Hrishikesh Maluskar
Ranch Hand

Joined: Jun 19, 2008
Posts: 115
thanks , i am able to display values on the JSP.
Is there any other method to display the values from arraylist without using iterator.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You can use JSTL's <c:forEach> tag.

Or a scriptlet.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: iterate problem in struts2