On 4/6/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> i have a question. Can two ActionForms be associated with the same Action
> class ..
>  if yes how.

One of my favorite approaches is to use "coarsely grained"
ActionForms. Rather than have  discrete ActionForms for each Action, I
create one with all the properties that an application or module will
need, and then just validate the ActionForm differently for each
workflow. To create different validations for the same ActionForm,
just give it a different name in the struts-config.

This way you can populate one ActionForm and obtain whatever input you
need. If the beans you want to "nest" are being passed to the business
logic (often *not* recommended), one solution would be to define
interfaces for the business logic beans (if they don't have them
already) and then have your ActionForm implement one or more of those
interfaces. To pass the ActionForm along, pass it under the business
logic interface.

In Struts Action 1.3 (currently at the test build stage), you can also
extend one DynaActionForm from another. This lets you create a base
DynaActionForm and then extend it for different workflows, just like a
conventional class.

There is a Struts Action 1.3.0 test build out now, or you can just use
the nightly build. It's stable and people are already using Action 1.3
in production.

* http://svn.apache.org/dist/struts/action-lib/

We just finished some restructuring work on the repository, and it's
possible that there might be a Struts Action 1.3.1 build available
later this month.


> I am new to struts.. although i have a couple of years experience in
> java/j2ee.

If you haven't already, be sure to review the lastest FAQs, to be sure
that you get started "on the right foot".

* http://struts.apache.org/faqs.html

HTH, Ted.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to