// Get the form data from the session context. The act of
// retrieving it causes it to be created if it isn't already there.
SessionFormData formData = formDataManager.getSessionFormData(fd);
// The fd in the session is built up over requests for subsequent
// fragments, so add the fields found in this request to it.
formData.addFieldDescriptors(fd.getFields());
// Set the form specifier (which identifies the form in the
// session) on the form descriptor and form attributes.
String formSpecifier = formData.getFormSpecifier();
xfFormAttributes.setFormSpecifier(formSpecifier);