HttpServletResponse response) throws Exception {
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 AdministrationSecurityService ();
Administrator administrator = null;
// perform authentication
try {
administrator = (Administrator) securityService.authenticate(username, password);
} catch (AuthenticationException e) {
if (e.getMessage().equals("Error initializing dao"))
errors.add(
ActionMessages.GLOBAL_MESSAGE,
new ActionMessage("error.database"));