src_ = src;
params_ = params;
// ensure that there is a form available
// through the rest of the flow
Form form = getForm();
if (form==null) {
throw new IllegalStateException("Action could not obtain the Form");
}
// find and save the action command
findCommand();
// call the subclass prepare()
// give it a chance to get ready for action
Map prepareResult = prepare();
if (prepareResult!=null) {
return prepareResult;
}
// attache callback hooks to the form
// in case the action subclasses are interested in
// form events
getForm().addFormListener(this);
Map result = null;
try {
// populate form with request parameters
// population is automatically followed by validation by default.
// If this is not the desired behaviour, the Form class can be subclassed
form.populate(objectModel);
result = perform();
} finally {
// since the action may be recycled immediately after
// the request. It is important that it's callback hooks