Description

controller (optional) - The controller to redirect to; defaults to the current controller if not specified

action - The action to redirect to, either a string name or a reference to an action within the current controller

id (optional) - The id to use in redirection

model - The model to chain to the next action

params (optional) - Parameters to pass to the action chained to.

The chain method stores the passed model in flash scope and then performs an HTTP redirect. The model is then restored for the next request. The model that will eventually be passed to the view will be created by starting with the model that was passed to the chain method and then adding to that all of the data that is in the model returned by the next action, which may replace some of the data that was in the model originally passed to the chain method. For example:

If a request is sent to the one action, that action chains to the two action which returns a model. The model that is passed to the view would contain [name: 'Anthony', town: 'Birmingham', country: 'England']

The chain method requires either a URI to redirect to or a controller/action/id name combination

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
Sponsored by SpringSource