1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.seasar.teeda.core.util; |
17 | |
|
18 | |
import java.io.IOException; |
19 | |
|
20 | |
import javax.faces.context.ExternalContext; |
21 | |
import javax.faces.context.FacesContext; |
22 | |
import javax.faces.internal.scope.RedirectScope; |
23 | |
|
24 | |
import org.seasar.framework.util.AssertionUtil; |
25 | |
import org.seasar.teeda.core.JsfConstants; |
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | 0 | public class PortletErrorPageManagerImpl extends ServletErrorPageManagerImpl { |
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
public boolean handleException(Throwable exception, FacesContext context, |
41 | |
ExternalContext extContext) throws IOException { |
42 | 0 | if (PortletUtil.isPortlet(context)) { |
43 | 0 | String location = getLocation(exception.getClass()); |
44 | 0 | if (location == null) { |
45 | 0 | return false; |
46 | |
} |
47 | 0 | storeErrorInfoToAttribute(extContext, exception); |
48 | 0 | RedirectScope.setRedirectingPath(context, location); |
49 | 0 | return true; |
50 | |
} else { |
51 | 0 | return super.handleException(exception, context, extContext); |
52 | |
} |
53 | |
} |
54 | |
|
55 | |
protected void storeErrorInfoToAttribute(ExternalContext extContext, |
56 | |
Throwable exception) { |
57 | 0 | AssertionUtil.assertNotNull("extContext", extContext); |
58 | 0 | AssertionUtil.assertNotNull("exception", exception); |
59 | 0 | extContext.getSessionMap().put(JsfConstants.ERROR_EXCEPTION, exception); |
60 | 0 | } |
61 | |
|
62 | |
} |