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.tapestry.IRequestCycle; |
21 |
|
import org.apache.tapestry.StaleSessionException; |
22 |
|
import org.apache.tapestry.error.StaleSessionExceptionPresenter; |
23 |
|
import org.apache.tapestry.services.ServiceConstants; |
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
0 |
public class PortletStaleSessionExceptionPresenter implements StaleSessionExceptionPresenter |
30 |
|
{ |
31 |
|
private PortletRequestGlobals _globals; |
32 |
|
|
33 |
|
public void presentStaleSessionException(IRequestCycle cycle, StaleSessionException cause) |
34 |
|
{ |
35 |
0 |
String markup = PortletMessages.staleSession(); |
36 |
|
|
37 |
0 |
ActionRequest request = _globals.getActionRequest(); |
38 |
|
|
39 |
0 |
request.getPortletSession(true).setAttribute( |
40 |
|
PortletConstants.PORTLET_EXCEPTION_MARKUP_ATTRIBUTE, |
41 |
|
markup); |
42 |
|
|
43 |
0 |
ActionResponse response = _globals.getActionResponse(); |
44 |
|
|
45 |
0 |
response.setRenderParameter(ServiceConstants.SERVICE, PortletConstants.EXCEPTION_SERVICE); |
46 |
0 |
} |
47 |
|
|
48 |
|
public void setGlobals(PortletRequestGlobals globals) |
49 |
|
{ |
50 |
0 |
_globals = globals; |
51 |
0 |
} |
52 |
|
} |