aspose file tools*
The moose likes Struts and the fly likes Iterating ActionForm Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Iterating ActionForm" Watch "Iterating ActionForm" New topic
Author

Iterating ActionForm

Dilip kumar
Ranch Hand

Joined: Oct 16, 2000
Posts: 360
Hello All,

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

Thanks much.
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
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

Joined: Aug 09, 2008
Posts: 21

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.;-)


cheers,
Makesh.

[URLyBird1.1.1 - > just started]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Iterating ActionForm