I was wondering how STRUTS does it's DynaFormBean creation? Does it create a .java file and then compile it? Is it all done with relfection and no .java file creation? Any relevent web site link with this info? Thanks.
Hi Greg, I am pretty sure the DynaBeans are creating using introspection. Here is what the Manning book says about the issue:
"The DynaActionForm (org.apache.struts.action.DynaActionForm) is designed so that you can specify simple JavaBean properties through the Struts configuration file.... The DynaActionForm is based on the DynaBean component of the Jakarta Commons [ASF Commons]. This is a clever object that stores the fields in an internal map but exposes them as standard JavaBean properties." (p. 162)
I haven't looked at the Commons code but I think introspection has to be going on if the keys of key / value pairs are being mapped and accessible through getter / setter pairs. Great question :-) Darryl
Originally posted by Darryl A. J. Staflund: Hi Greg, I haven't used introspection myself in any direct manner but I think a search for the word 'reflection' will pull up some interesting threads in the 'Advanced Java' forum. Darryl