Configuring the controller
We'll place our controller configuration into /WEB-INF/calyxo-control-config.xml. It looks like this:
<calyxo-control-config version="0.9"
xmlns="http://calyxo.odysseus.de/xml/ns/control">
<actions>
<!-- The index action just forwards to our login page -->
<action path="/index">
<dispatch path="/WEB-INF/jsp/login.jspx"/>
</action>
<!-- Login action -->
<action path="/login" class="de.odysseus.calyxo.sample.login.LoginAction">
<dispatch name="success" path="/WEB-INF/jsp/welcome.jspx"/>
<dispatch name="input" path="/WEB-INF/jsp/login.jspx"/>
</action>
<!-- Logout action -->
<action path="/logout"
class="de.odysseus.calyxo.sample.login.LogoutAction">
<dispatch name="success" path="/WEB-INF/jsp/goodbye.jspx"/>
</action>
</actions>
</calyxo-control-config>
DTD lookup
Many XML editors allow to associate root element names with
DTDs. If your editor supports this, you may want to associate
calyxo-control-config with
CALYXO_HOME/calyxo-control/conf/share/calyxo-control-config.dtd.
Alternatively, you should adjust the DTD system path or simply
copy the DTD file to your /WEB-INF directory.
Let's explore the elements and attributes used above:
- You must declare the xmlns="http://calyxo.odysseus.de/xml/ns/control" and version="0.9" attributes in the root element.
- The actions element contains a sequence of action elements, which define the entry points of the module.
- An action has a mandatory path attribute. The action path is the action's module relative address. It must start with a slash (/).
- An action may contain dispatch elements. A dispatch has a name attribute. By omitting this attribute, the action's default dispatch is defined. A dispatch may branch to another action by specifying the action attribute or to an application resource by specifying the path attribute.
- If an action has a class attribute, its value is taken to be an action class name (subclass of de.odysseus.calyxo.control.Action), whose execute() method will be called to invoke that action.
- If an action's class attribute is omitted, the controller will insert a default action, which dispatches according to the default dispatch element (the one without a name attribute).
Our sample configuration only uses a small subset of the available elements. Beyond what you have seen so far, you can
- define exception handlers
- define global dispatches
- pass parameters or parameter sets to actions
- declare plugins to be loaded by the module
- use your own dispatchers
- use filters to build action chains
For these advanced features of the controller, please refer to the Calyxo Control component documentation.


