Controller Interface
From AgileApps Support Wiki
(Redirected from Controller Class)
You implement the Controller interface to create an instance of a worker class and call its methods to perform operations.
For more, see Working with Pages and Classes and ControllerResponse Class.
execute
This method is called when a user submits a <form> in a page with an action attribute that specifies the URL of a class that implements the Controller interface.
Your implementation of this method does the following:
- Creates an instance of a worker bean
- Creates an instance of ControllerResponse
- Calls the worker bean's methods
- Sets the return data via ControllerResponse.setData
- Sets the next page to display via ControllerResponse.setTargetPage
Syntax
ControllerResponse execute(HashMap params) throws Exception;
Parameters
- params
- The HTML form <input> fields in the page. For each field:
- The key of params is the name attribute of the <input> tag
- The value of params is the value attribute of the <input> tag