Dashboard > WebWork 1 > WebWork CookBook > Action Aliasing
  WebWork 1 Log In View a printable version of the current page.  
  Action Aliasing
Added by Anders Hovmöller, last edited by Hani Suleiman on Apr 25, 2004  (view change)
Labels: 
(None)

Action aliasing means that you give an alternate name to an action. This is very useful if you want to reuse an action in multiple action chains without having to corrupt the logic of the action itself with knowledge of this.

An example of this would be that we have an action AdjustPrice that calculates discounts for the current user in a shop application. We might want to have different steps for cars than we want for groceries but the discount scheme is the same so we want to reuse this code. With some simple action aliasing in views.properties we can do this easily:

AdjustCarPrice.action=SelectCar
AdjustCarPrice.success=ChangeCarPrice.action
ChangeCarPrice.action=AdjustPrice
ChangeCarPrice.success=showcar.jsp

AdjustFoodPrice.action=SelectFood
AdjustFoodPrice.success=ChangeFoodPrice.action
ChangeFoodPrice.action=AdjustPrice
ChangeFoodPrice.success=showfood.jsp

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request - Contact Administrators