Replacing the view called by a controller command

To replace the view called by a controller command, create a new implementation class for the controller command. For example, create a new ModifiedControllerCmdImpl that extends ExistingControllerCmdImpl and implements the ExistingControllerCmd interface. Note that this is only applicable to the Web application layer.


About this task

Within the ModifiedControllerCmdImpl class, override the performExecute method. In the new performExecute method, call super.performExecute to ensure that all command processing occurs. After the command logic is executed, we can use the response properties to override the view called. The following code snippet displays how to override a redirect view:

The following code snippet displays how to override a forward view:


Related tasks
Customizing existing controller commands