File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Iterating ActionForm

 
Dilip kumar
Ranch Hand
Posts: 360
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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.;-)
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic