// "mailAccountForm" defined in struts-config-preference.xml
DynaActionForm accountForm = (DynaActionForm)form;
MailHome home = (MailHome)CVUtility.getHomeObject("com.centraview.mail.MailHome", "Mail");
try {
// get the account ID from the form bean
Integer accountID = (Integer)accountForm.get("accountID");
// now, check the account ID on the form...
if (accountID == null || accountID.intValue() <= 0) {
// if account ID is not set on the form, then there is
// no point in continuing forward. Show user the door. :-)
allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Account ID"));
return mapping.findForward(forward);
}
Mail remote = (Mail)home.create();
remote.setDataSource(dataSource);
MailAccountVO accountVO = remote.getMailAccountVO(accountID.intValue());
// account name - required