Forms Configure
We'll create a forms configuration file for our outside module. The file will contain a form definition for our login form. Save the following to /WEB-INF/calyxo-forms-config-outside.xml:
<calyxo-forms-config version="0.9"
xmlns="http://calyxo.odysseus.de/xml/ns/forms">
<forms>
<form name="login">
<field property="user">
<match name="regexp">
<property name="pattern" value="^[a-z][a-zA-Z0-9]{2,7}$"/>
<message bundle="messages" key="login.user.invalid"/>
</match>
</field>
<field property="password">
<match name="notEmpty">
<message>
<arg name="field" value="password"/>
</message>
</match>
</field>
<assert test="input.user != input.password">
<message bundle="messages" key="login.userAndPasswordEqual"/>
</assert>
</form>
</forms>
</calyxo-forms-config>
The configuration defines a form named login with two input fields:
- the user field contains a match element, which uses the predefined regexp matcher. We specify the pattern to be used with the property element. We also have a message element, with both, the bundle and key attributes set. This overrides the generic message from the regexp matcher.
- the password field uses the predefined notEmpty matcher. In the contained message element, it passes a value for the field argument to the message defined by the notEmpty matcher.
- The assert expression takes an EL expression in its test attribute. It fails, if the expression evaluates to false, that is, if the user id and password are equal.


