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

PropertyReturnsDescription
functionStringName 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.
functionPtrVarArgFunctionDirect 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.
methodStringThe HTTP method this entry matches, for example GET or POST. May be null, in which case this entry never matches by method.
requiredParameterStringName of the request parameter that must be present for this method to match. Null if no parameter is required.
viewViewThe 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.

ParameterDescription
reqMethodthe request method to check
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.