• 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

Datagrid in Struts 2

 
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am developing a web application using struts 2 framework and with apache-tomcat 5.x..

I would like to know how to use datagrid in jsp using struts 2 or Is there any alternate way to display the dynamic datas from a database in a table represntation
 
Ranch Hand
Posts: 689
Scala Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi..

If you want to display date into jsp page first define one list and through query get result and set into list variable.

with this variable list just iterate list variable. For Example.

for list define

private List<user> user= userDelegator.getuser();

this is with Struts2 + hibernate getuser gives user list then iterate like.

getUser mathod call

{
List<user> userlist = session.createCriteria(User.class).list();
return userlist;
}

<s:iterator value="user">
<tr>
<td>
<s:text name="userName" />
</td>
<td>
<s:text name="userEmail" />
</td>
<td>
<s:a href="edituser.action?id=%{id}">Edit</s:a>
</td>
</tr>
</s:iterator>

here userName and userEmail is Hibernate DTO name which gives you to value of user name and Email.

Thanks,
Nishan Patel.
 
There's a hole in the bucket, dear Liza, dear Liza, a hole in the bucket, dear liza, a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic