Modules

Calyxo applications are composed of modules. Modules are independent units, you may think of them as subapplications. A module is a container for actions. An action will be invoked (or executed), when it is selected by a request.

A module is represented by its context. The module context provides access to module properties and services, like

As you can see, a module context provides its own attribute scope, just like the servlet context does. Only, it is private to that module. Calyxo stores all its configuration information inside module scopes to prevent name clashes between modules.

In a real application, an incoming request has to be mapped to its corresponding module. That is, a context relative path gets decomposed into a module part (identifying the module) and an action path (relative to the module). As mentioned above, a module context provides the inverse mapping, answering the question: how do I access a particular action within the module from outside?

Calyxo provides access to module contexts through accessors, that may be used in JSTL expressions, for example

${calyxo.base.module.name}
${calyxo.base.module.attribute['foo']}
${calyxo.base.module.forName['clients'].path['/list']}

The last example may be used to build URLs pointing to an action in some specific module. However, Calyxo also provides a custom JSP tag, that clones HTML's <a> tag, but replaces the href attribute with module and action attributes.