• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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






 
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Collections of objects are how essentially every single Java application in the world works--objects are the primary way Java stores data.
 
reply
    Bookmark Topic Watch Topic
  • New Topic