6.5 Some background
6.5.1 Routing structure
From a conceptual point of view, a routing structure can contain the following types of components:
-
A router: forwards a request to another component, based on certain properties of the request, often the request path.
-
A filter: something which can be put in between two other routing components and performs some action before and/or after forwarding the request to the next component.
-
A request handler: the endpoint of the routing. This is the place where application-specific logic is implemented and the response is created. (in Kauri, request handlers are instances of org.restlet.Restlet)
All these components can be freely nested inside each other, in order to form a hierarchical routing structure. The request handlers are the leaves of the routing structure.
When you think a bit about it, there is no fixed line where the routing ends. A request handler in itself might contain code which makes decisions based on request properties and delegates to other methods or classes. We don't consider this to be part of the routing anymore though since it is not visible in the routing configuration and hence Kauri doesn't know about it.
Previous