Actions

Using Calyxo Forms with Struts doesn't require special action classes. However, you may want to interfere with Calyxo Forms when accessing validated form properties or committed form data. Everything starts by getting a reference to the module's FormsSupport instance:

FormsSupport support = FormsSupport.getInstance(request);

Form Properties

The most essential thing is to access the validated form properties:

FormProperties properties = support.getFormProperties(request, mapping.getPath());
Date arrival = (Date)properties.getProperty("arrival");

To commit the form properties, use

properties.commit();

Please refer to the Calyxo Forms Concepts for further details.

Form Data

The FormsSupport instance may also be used to access, remove or re-create saved form data for some action. This is useful if you want to initialize form data before (re)displaying the form:

FormData data = support.getFormData(request, "/checkin", true);
data._setProperty("arrival", new Date());

or

support.removeFormData(request, "/checkin");

Please refer to the Calyxo Forms Concepts for further details.