This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Help me out to list a table of conent in jsp using struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Help me out to list a table of conent in jsp using struts2" Watch "Help me out to list a table of conent in jsp using struts2" New topic
Author

Help me out to list a table of conent in jsp using struts2

biny panackal
Ranch Hand

Joined: Apr 12, 2007
Posts: 72
hi all,
i am a bit confused that whether i can able to build user friendly applications using struts 2. Now i need to display a list of details say.
employee_cod | name | address | phone number
_________________________________________
01 biny xxx 444
02 xx xxx xxx


how can i do that. is there any tag for displaying things as tables an i also must be able to edit the records on a the click of the row..


If any body know any solution please help me.


All attempts are highly appritiable...

Regards,
Biny Balan
binypanackal@gmail.com







Biny Balan
binypanackal@gmail.com
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 368
you can do this by using logic:iterate Tag of struts custom tags.

By using this tag you can iterate arraylist of plain java objs,each obj having feild you required
i.e. employee_cod | name | address | phone number.
Inside iterate Tag use html:text tag to display values of variable, that is editable due to text tag used.


Thanks,
Shailesh
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

i am a bit confused that whether i can able to build user friendly applications using struts 2.

Of course you can.

There's no tag for doing exactly what you want, though. There are several options: you can build the table by hand and use JavaScript to handle a row click, or use something like DisplayTag to build the bulk of the table (but I think you'd still have to handle editing etc. with JavaScript, but I'm not really familiar with DisplayTag), or find a third-party open-source or commercial component that does all the work for you.
biny panackal
Ranch Hand

Joined: Apr 12, 2007
Posts: 72
i got it . But i dont know wether it is the actual way to do it...


bean class





fillQuestionList class used to fill the ArrayList






Plain Objec(Pojo) class




JSP Code





It is using an object for each row. Wether it will create problem with garbage collection which in terms reduse the speed of my application .

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Collections of objects are how essentially every single Java application in the world works--objects are the primary way Java stores data.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help me out to list a table of conent in jsp using struts2
 
Similar Threads
jdbc problem
what the Class.forName doing exactly.
String and String buffer difference
tree with check box.
JBoss configuration