STRUTS ACTION - AGGREGATING ACTIONS IN STRUTS
If you are a Struts developer then you might have experienced the pain of writing huge number of Action classes for your project. The latest version of struts provides classes using which you can aggregate a related set of actions into a single unified action. In this article we will see how to achieve this. Struts provides four important classes for this purpose. These classes are called as Dispatchers. The important Dispatchers that struts provides includes : DispatchAction , ActionDispatcher , LookupDispatchAction and MappingDispatchAction . All these classes can be found in the package org.apache.struts.actions . Let us look in to each of these in detail. Our examples use the simple CRUD actions. DispatchAction: In this type of aggregation, the action class must extend DispatchAction class as shown. public final class CRUDDispatchAction extends DispatchAction { public ActionForward create(ActionMapping mapping, ActionForm form, HttpServletRequest reque