1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
HttpSession session = request.getSession();
ActionErrors errors = new ActionErrors();
// prevent bug when accessing directly to authorizationFailedURI without authenticate
if ((Class) session.getAttribute(HttpConstants.LOGIN_EXCEPTION_CLASS) != null) {
ActionMessage amClass = new ActionMessage(((Class) session.getAttribute(HttpConstants.LOGIN_EXCEPTION_CLASS))
.getName(), false);
ActionMessage amMessage = new ActionMessage((String) session.getAttribute(HttpConstants.LOGIN_EXCEPTION_MESSAGE),
false);
// the LOGIN_EXCEPTION_CLASS is not put in the errors mechanism to
// hide to the final user the exception class => this is not a user concern,
// and can be evaluated as a security risk (give information about what
// security system is used to securize your webapp)
// errors.add(HttpConstants.LOGIN_EXCEPTION_CLASS,amClass);
errors.add(HttpConstants.LOGIN_EXCEPTION_MESSAGE, amMessage);
saveMessages(request, errors);
}
return mapping.findForward("authenticationFailedOK");
} |
Partager