// perform the JAAS login; it will callback on the callbackHandler to
// obtain
// username and password
try {
LoginContext loginContext = new LoginContext(jaasApplicationName,
callbackHandler);
loginContext.login();
request.getSession().setAttribute("SUBJECT", loginContext.getSubject());
// redirect to the main menu page
response.sendRedirect(request.getContextPath() + successRedirectUrl);
} catch (LoginException le) {
// redirect to the error page