Meaningless Drivel is fun!*
The moose likes Struts and the fly likes Struts 2 Iterate tag not getting the customed format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 Iterate tag not getting the customed format" Watch "Struts 2 Iterate tag not getting the customed format" New topic
Author

Struts 2 Iterate tag not getting the customed format

kajal mukergi
Ranch Hand

Joined: Mar 22, 2007
Posts: 102
Hi Friends

I have to get data in following format

Name, Number - button

but the struts iterate tag is giving me night mare

In java



In JSP



and result is



[max, AAAA, DDD, TTT, NNN, CCCC, PP, 111, 2222, 3333, 4444, 55555, 6666, 77777]


but i need in this format

max 111
aaaa 22222
ddd 3333
.
.
.

can any one tell me how to get this type of format


David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

While I hesitate to tell you this, since in my opinion it's the wrong way to do it, see the merge tag.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Now that I think about it, that's actually not going to help much. It'd be easier, and much, much cleaner, to just do it right. Pass a list of objects, each containing the two elements you want to display on the same line.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 2 Iterate tag not getting the customed format
 
Similar Threads
printing out all my instances...toString() method..
problem with hashmap and <s:iterator> tag in struts2
Reference Specific Line in Text File
xsl:value-of
how to retrive session object / struts