public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
String username = ((LogonForm) form).getUsername();
String password = ((LogonForm) form).getPassword();
// Save our logged-in user in the session,
// because we use it again later.
HttpSession session = request.getSession();
session.setAttribute(Constants.USER_KEY, form);
// Log this event
StringBuffer message = new StringBuffer("LogonAction: User '");
message.append(username);
message.append("' logged on in session ");
message.append(session.getId());
servlet.log(message.toString());
// Forward control to the success URI
// specified in struts-config.xml
return (mapping.findForward(Constants.CONTINUE));
}
Login the user.
The event is logged if the debug level is >= Constants.DEBUG. |