1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kns.web.struts.form.pojo; |
17 | |
|
18 | |
import org.apache.commons.logging.Log; |
19 | |
import org.apache.commons.logging.LogFactory; |
20 | |
import org.apache.struts.Globals; |
21 | |
import org.apache.struts.action.ActionForm; |
22 | |
import org.apache.struts.action.ActionForward; |
23 | |
import org.apache.struts.action.ActionMapping; |
24 | |
import org.apache.struts.action.ExceptionHandler; |
25 | |
import org.apache.struts.config.ExceptionConfig; |
26 | |
|
27 | |
import javax.servlet.http.HttpServletRequest; |
28 | |
import javax.servlet.http.HttpServletResponse; |
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | 0 | public class AuthorizationExceptionHandler extends ExceptionHandler { |
34 | |
|
35 | |
private static final String AUTHORIZATION_EXCEPTION_HANDLER = "authorizationExceptionHandler"; |
36 | |
|
37 | 0 | private static final Log LOG = LogFactory.getLog(AuthorizationExceptionHandler.class); |
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
|
44 | |
|
45 | |
|
46 | |
@Override |
47 | |
public ActionForward execute(Exception exception, ExceptionConfig exceptionConfig, ActionMapping mapping, ActionForm form, HttpServletRequest request, |
48 | |
HttpServletResponse response) { |
49 | |
|
50 | 0 | if (LOG.isTraceEnabled()) { |
51 | 0 | String message = String.format("ENTRY %s", exception.getMessage()); |
52 | 0 | LOG.trace(message); |
53 | |
} |
54 | |
|
55 | 0 | request.setAttribute(Globals.EXCEPTION_KEY, exception); |
56 | |
|
57 | 0 | ActionForward forward = mapping.findForward(AUTHORIZATION_EXCEPTION_HANDLER); |
58 | |
|
59 | 0 | if (LOG.isTraceEnabled()) { |
60 | 0 | LOG.trace(String.format("EXIT %s", exception.getMessage())); |
61 | |
} |
62 | |
|
63 | 0 | return forward; |
64 | |
} |
65 | |
|
66 | |
} |