1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| package org.apache.tapestry.portlet; |
16 |
| |
17 |
| import javax.portlet.ActionRequest; |
18 |
| import javax.portlet.ActionResponse; |
19 |
| |
20 |
| import org.apache.hivemind.ApplicationRuntimeException; |
21 |
| import org.apache.tapestry.IRequestCycle; |
22 |
| import org.apache.tapestry.StaleSessionException; |
23 |
| import org.apache.tapestry.error.RequestExceptionReporter; |
24 |
| import org.apache.tapestry.error.StaleSessionExceptionPresenter; |
25 |
| import org.apache.tapestry.services.ServiceConstants; |
26 |
| |
27 |
| |
28 |
| |
29 |
| |
30 |
| |
31 |
| public class PortletStaleSessionExceptionPresenter implements StaleSessionExceptionPresenter |
32 |
| { |
33 |
| private PortletRequestGlobals _globals; |
34 |
| |
35 |
0
| public void presentStaleSessionException(IRequestCycle cycle, StaleSessionException cause)
|
36 |
| { |
37 |
0
| String markup = PortletMessages.staleSession();
|
38 |
| |
39 |
0
| ActionRequest request = _globals.getActionRequest();
|
40 |
| |
41 |
0
| request.getPortletSession(true).setAttribute(
|
42 |
| PortletConstants.PORTLET_EXCEPTION_MARKUP_ATTRIBUTE, |
43 |
| markup); |
44 |
| |
45 |
0
| ActionResponse response = _globals.getActionResponse();
|
46 |
| |
47 |
0
| response.setRenderParameter(ServiceConstants.SERVICE, PortletConstants.EXCEPTION_SERVICE);
|
48 |
| } |
49 |
| |
50 |
0
| public void setGlobals(PortletRequestGlobals globals)
|
51 |
| { |
52 |
0
| _globals = globals;
|
53 |
| } |
54 |
| } |