my dog learned polymorphism
The moose likes Struts and the fly likes Struts2 in Action: DispatchAction 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 "Struts2 in Action: DispatchAction" Watch "Struts2 in Action: DispatchAction" New topic

Struts2 in Action: DispatchAction

Beppe Catanese

Joined: Nov 07, 2006
Posts: 28
In my experience with Struts2 I could not see the replacement of DispatcAction. In Struts1 the possibility to associate methods of the Action class with specific URL (using the parameter attribute in struts.config) was really useful but it seems now it is no longer available in Struts2.
Is it because of the new architecture (loosely coupled with the Servlet API)? Or is there another way to do request-method mapping?


Don Brown

Joined: Apr 22, 2008
Posts: 25
You could say that now DispatchAction is now the default in Struts 2. You can execution any no-arg method on an action by using the "action!method" syntax, so if you had an action at "", you can execute its list method via "accounts!". And yes, you can also turn this feature off or use wildcards to use a different technique to specifying methods.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Struts2 in Action: DispatchAction
It's not a secret anymore!