You might want to clarify what you mean by form class. Struts offers a
base ActionForm class. This class is a JavaBean wrapper that works with
the HTML Form tag to automagically populate the fields on your form. It
also provides a built-in validation mechanism that works with the Struts
Action Class.

The ActionForm class for a HTML Form tag can be specified in the Struts
configuration file, or with the tag. There's not a way to specify more
than one ActionForm class in either of these places. Of course, you
could have more than one HTML form in your JSP, and associate different
ActionForm classes with each. Here, you would specify the ActionForm as
the "name" property to the Struts HTML form tag. 

I haven't tried it myself, but the form tags also accept a name
property, which may imply that you can use different ActionForm classes
for different fields.

Here's an answer to a different question: Can I use more than one entity
bean with my ActionForm beans?

Often, there is a one:one relationship between the ActionForm class and
an entity bean class that represents your table. However, you can now
nest other JavaBeans, of any class, within the ActionForm subclass. So,
a good way to go is to define a different entity bean classes for each
of your tables, and then encapsulate these within your ActionForm
subclass. 

See the Bean Developers guide 

<
http://jakarta.apache.org/struts/api/org/apache/struts/taglib/bean/package-summary.html#package_description
>

for more about the syntax for addressing nested properties. This syntax
also works for HTML tags.

> Mallari Kulkarni wrote:
> 
> Hi,
> 
> I wanted to have more than one form class for   a  one jsp file.
> Because in my one jsp file,  i have a information of 4 tables. So i
> want to transfer the information to 4  formclasses?  Is it possible?
> 
> Please help me.
> 
> Regards
> Mallari

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/

Reply via email to