• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How does Dyna stuff work in STRUTS

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Darryl A. J. Staflund
Ranch Hand
Posts: 314
2
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Darryl. Where can I find some information on Introspection and how that works? It seems like an interesting concept.
 
Darryl A. J. Staflund
Ranch Hand
Posts: 314
2
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

Thanks again Darryl. I will check it out.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic