This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes Creating Nested FormBean  using DynaActionForm Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Creating Nested FormBean  using DynaActionForm" Watch "Creating Nested FormBean  using DynaActionForm" New topic
Author

Creating Nested FormBean using DynaActionForm

Kalyana Sundaram
Ranch Hand

Joined: Mar 18, 2005
Posts: 94
1) Can I give my application specific Class in the "type" attribute of <form-property> tag in DynaActionForm?
2) How to Create Nested FormBean using DynaActionForm?

Thanks in Advance!


Only those who will risk going too far can possibly find out how far one can go !!!
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Originally posted by Kalyana Sundaram:
1) Can I give my application specific Class in the "type" attribute of <form-property> tag in DynaActionForm?

Yes, you can.
Originally posted by Kalyana Sundaram:
2) How to Create Nested FormBean using DynaActionForm?

Just use "dot notation". For example, if the nested bean is a bean named "user" with an attribute of "firstName", you could write the following:

[ September 23, 2007: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
Kalyana Sundaram
Ranch Hand

Joined: Mar 18, 2005
Posts: 94
Well Merrill, Thanks for the reply. That explains me of how to use beans with nested properties in a JSP.

I am wondering, how FormBeans with nested properties can be declared as a DynaActionForm in struts-config.xml!
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Just specify the class for the bean in the type attribute. Example:
 
Don't get me started about those stupid light bulbs.
 
subject: Creating Nested FormBean using DynaActionForm