HttpSession session = request.getSession();
String username = (String) PropertyUtils.getSimpleProperty(form,"username");
String password = (String) PropertyUtils.getSimpleProperty(form,"password");
ActionMessages errors = new ActionMessages();
SecurityService securityService = new CustomerSecurityService();
Customer customer = null;
// perform authentication
try {
customer = (Customer) securityService.authenticate(username, password);
} catch (AuthenticationException e) {
if (e.getMessage().equals("Error initializing dao"))
errors.add(
ActionMessages.GLOBAL_MESSAGE,
new ActionMessage("error.database"));