Binds one HTTP method, such as GET or POST, on a ControllerMapping to the JS function that handles it, an optional required request parameter, and the view used to render the result. A ControllerMapping holds a list of these, one per method variant it supports, and picks the first entry whose HTTP method and required parameter match the incoming request. Instances are created by ControllerMappingBuilder when an app registers a method handler, either by function name or by a direct JS function reference. Serialised to XML as a controller element, with the method, required parameter and view held as attributes.
Group: App Definitions
Implements: Serializable
Properties
| Property | Returns | Description |
|---|---|---|
| function | String | Name of the JS function registered to handle this method, looked up and invoked on the app's script engine. Null when the handler was registered as a direct function reference instead, see getFunctionPtr. |
| functionPtr | VarArgFunction | Direct reference to the JS function that handles this method, called without an engine lookup. Null when the handler was registered by name instead, see getFunction. |
| method | String | The HTTP method this entry matches, for example GET or POST. May be null, in which case this entry never matches by method. |
| requiredParameter | String | Name of the request parameter that must be present for this method to match. Null if no parameter is required. |
| view | View | The view used to render the result of this method, overriding the controller mapping's default view. May be null, in which case the mapping's default view is used instead. |
Methods
getMethod()
Returns: String
The HTTP method this entry matches, for example GET or POST. May be null, in which case this entry never matches by method.
getFunction()
Returns: String
Name of the JS function registered to handle this method, looked up and invoked on the app's script engine. Null when the handler was registered as a direct function reference instead, see getFunctionPtr.
getFunctionPtr()
Returns: VarArgFunction
Direct reference to the JS function that handles this method, called without an engine lookup. Null when the handler was registered by name instead, see getFunction.
getRequiredParameter()
Returns: String
Name of the request parameter that must be present for this method to match. Null if no parameter is required.
getView()
Returns: View
The view used to render the result of this method, overriding the controller mapping's default view. May be null, in which case the mapping's default view is used instead.
is(Method reqMethod)
Returns: boolean
Checks whether the given request method is the HTTP method this entry handles.
| Parameter | Description |
|---|---|
reqMethod | the request method to check |