ActionMessages messages = new ActionMessages();
String username = (String) PropertyUtils.getSimpleProperty(form, "username");
String password = (String) PropertyUtils.getSimpleProperty(form, "password");
SecurityService service = new SecurityService();
service.authenticate( username, password);
User user = new User();
user.setUsername(username);
request.getSession().setAttribute("user", user);
ActionMessage message = new ActionMessage("message.login.success", username);
messages.add(ActionMessages.GLOBAL_MESSAGE, message);
if (!messages.isEmpty()) {
saveMessages( request.getSession(true), messages );
}
return mapping.findForward("success");