|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| package org.apache.tapestry.error; |
|
16 |
| |
|
17 |
| import java.io.IOException; |
|
18 |
| |
|
19 |
| import org.apache.tapestry.IPage; |
|
20 |
| import org.apache.tapestry.IRequestCycle; |
|
21 |
| import org.apache.tapestry.StaleSessionException; |
|
22 |
| import org.apache.tapestry.services.ResponseRenderer; |
|
23 |
| |
|
24 |
| |
|
25 |
| |
|
26 |
| |
|
27 |
| |
|
28 |
| |
|
29 |
| |
|
30 |
| |
|
31 |
| public class StaleSessionExceptionPresenterImpl implements StaleSessionExceptionPresenter |
|
32 |
| { |
|
33 |
| private ResponseRenderer _responseRenderer; |
|
34 |
| |
|
35 |
| private String _pageName; |
|
36 |
| |
|
37 |
12
| public void presentStaleSessionException(IRequestCycle cycle, StaleSessionException cause)
|
|
38 |
| throws IOException |
|
39 |
| { |
|
40 |
12
| IPage exceptionPage = cycle.getPage(_pageName);
|
|
41 |
| |
|
42 |
12
| cycle.activate(exceptionPage);
|
|
43 |
| |
|
44 |
12
| _responseRenderer.renderResponse(cycle);
|
|
45 |
| } |
|
46 |
| |
|
47 |
6
| public void setPageName(String pageName)
|
|
48 |
| { |
|
49 |
6
| _pageName = pageName;
|
|
50 |
| } |
|
51 |
| |
|
52 |
6
| public void setResponseRenderer(ResponseRenderer responseRenderer)
|
|
53 |
| { |
|
54 |
6
| _responseRenderer = responseRenderer;
|
|
55 |
| } |
|
56 |
| |
|
57 |
| } |