This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Struts and the fly likes Dyna Action  Vs  Dispatch Action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Dyna Action  Vs  Dispatch Action" Watch "Dyna Action  Vs  Dispatch Action" New topic

Dyna Action Vs Dispatch Action

kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1404
What is the difference between Dyna Action and Dispatch Action ?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
There is no such thing as a "Dyna Action". There is a DynaActionForm which allows you to specify the properties of an ActionForm in the struts-config.xml file, rather than writing a class that extends ActionForm.

A DispatchAction is:

An abstract Action that dispatches to a public method that is named by the request parameter whose name is specified by the parameter property of the corresponding ActionMapping. This Action is useful for developers who prefer to combine many similar actions into a single Action class, in order to simplify their application design.

For example, you might have four buttons on the same form. If your Action extends DispatchAction, you can have four different methods in the same action the perform the four different functions without having to write four separate Action classes.

Here's the link to the Struts Javadoc You can use it to check out the details

Consultant, Sima Solutions
vivek karemore

Joined: Oct 21, 2013
Posts: 3

I had a question in one of my interview about the Dyna Action in struts, can anybody tell me about this?
Joe Ess

Joined: Oct 29, 2001
Posts: 9168

First, Avoid anyone using Struts 1.
Next, see Merrill's post above.

[How To Ask Questions On JavaRanch]
subject: Dyna Action Vs Dispatch Action
It's not a secret anymore!