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