This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Action forms 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 "Action forms" Watch "Action forms" New topic
Author

Action forms

Anjali Naveen
Greenhorn

Joined: Jun 28, 2005
Posts: 15
Hi
I have a jsp page which has name and address fields, education details etc.can i have the action form as

class Details extends ActionForm{
String name;
Address obj;
String degree;

getters and setters for the above
}

class Address{
String address1;
String city;
String state;

getters and setters for the above
}

so my main action form will be a composition. can this be done??
Anjali
Kerry Wilson
Ranch Hand

Joined: Oct 29, 2003
Posts: 254
If address1 is an inner class, I do not if it will work. However, if it is a normal seperate class, it should work. Just access properties with standard dot notation ( i.e. address.city ) in you struts:html tags


http://www.goodercode.com
SCJP 1.4
 
wood burning stoves
 
subject: Action forms
 
Similar Threads
how to solve this
Printing out info from mysql database
paramsPrepareParams OgnlException setProperty()
Command object is not setting up properly
Adding Dynamic Rows to Table using addrow button