SecurityService securityService = new CustomerSecurityService();
Customer customer = null;
// perform authentication
try {
customer = (Customer) securityService.authenticate(customerForm.getUsername(), customerForm.getPassword());
} catch (AuthenticationException e) {
if (e.getMessage().equals("Error initializing dao"))
errors.add(
ActionMessages.GLOBAL_MESSAGE,
new ActionMessage("error.database"));