permaculture playing cards*
The moose likes Struts and the fly likes ActionForm and introspection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ActionForm and introspection" Watch "ActionForm and introspection" New topic
Author

ActionForm and introspection

Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

hi,
ActionForm is based on introspection and i am wondering how exactly introspection works.

Let's suppose that i have this foo ActionForm class for a JSP that has only one text field that i call "phone":




1) the property "blah" is different from Phone : is that a problem, regarding introspection ?
2) Introspection only checks the getter and setter methods, not the properties (here "blah"), correct ?


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Your understanding is correct. The Apache Commons BeanUtils that Struts uses assumes that ActionForm follows the JavaBean rules, which includes the fact that all properties are expected to have getters and setters following certain naming conventions. BeanUtils looks only at the getter and setter, not at the instance variable.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ActionForm and introspection
 
Similar Threads
Panel vs Frame
Islands of Isolation
what's "staic class"?
main() is the entry point
SCJP6 book page 298 errata