Splitting the configuration

Now we know enough to create the controller configurations for our modules. The outside module hosts the login.jsp and goodbye.jsp pages, because they're presented to users, who are not logged in. Here's calyxo-control-config-outside.xml:

<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>

    <!-- This action shows the goodby page -->
    <action path="/goodbye">
      <dispatch path="/WEB-INF/jsp/goodbye.jspx"/>
    </action>

    <!-- Login action -->
    <action path="/login" class="de.odysseus.calyxo.sample.login.LoginAction">
      <dispatch name="success" module="inside" action="/index"/>
      <dispatch name="input" path="/WEB-INF/jsp/login.jspx"/>
    </action>

  </actions>

</calyxo-control-config>  

As you can see, we switch to module inside in the success dispatch element of the /login action.

calyxo-control-config-inside.xml 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 welcome page -->
    <action path="/index">
      <dispatch path="/WEB-INF/jsp/welcome.jspx"/>
    </action>

    <!-- Logout action -->
    <action path="/logout" class="de.odysseus.calyxo.sample.login.LogoutAction">
      <dispatch name="success" module="outside" action="/goodbye"/>
    </action>

  </actions>

</calyxo-control-config>  

With the success dispatch of our /logout action, we switch back to module outside.