• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Iterating ActionForm

 
Dilip kumar
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

Is there any way I can get the list of fields & values dynamically from the ActionForm ?

Thanks much.
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can create a sub-class of the ActionForm class and (1) create a method that returns a list of fields and values, or (2) override the toString() method and have it return a list of fields and values.

Create your application-specific ActionForms by having them extend this sub-class rather that the Struts class directly.
[ October 03, 2008: Message edited by: James Clark ]
 
Makeshkumar Subramaniam
Greenhorn
Posts: 21
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can get an class/object 's fields and methods using java's Reflection API ...search with google about reflection api java........learn it and do it..enjoy.;-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic