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 |
|
import javax.portlet.PortletException; |
22 |
|
|
23 |
|
import org.apache.tapestry.services.WebRequestServicer; |
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
2 |
public class ActionRequestServicerToWebRequestServicerBridge implements ActionRequestServicer |
33 |
|
{ |
34 |
|
private PortletRequestGlobals _portletRequestGlobals; |
35 |
|
|
36 |
|
private WebRequestServicer _webRequestServicer; |
37 |
|
|
38 |
|
public void service(ActionRequest request, ActionResponse response) throws IOException, |
39 |
|
PortletException |
40 |
|
{ |
41 |
2 |
_portletRequestGlobals.store(request, response); |
42 |
|
|
43 |
2 |
PortletWebRequest webRequest = new PortletWebRequest(request); |
44 |
2 |
PortletWebResponse webResponse = new PortletWebResponse(response); |
45 |
|
|
46 |
|
try |
47 |
|
{ |
48 |
2 |
_webRequestServicer.service(webRequest, webResponse); |
49 |
|
} |
50 |
1 |
catch (RuntimeException ex) |
51 |
|
{ |
52 |
1 |
throw new PortletException(ex); |
53 |
1 |
} |
54 |
1 |
} |
55 |
|
|
56 |
|
public void setPortletRequestGlobals(PortletRequestGlobals portletRequestGlobals) |
57 |
|
{ |
58 |
2 |
_portletRequestGlobals = portletRequestGlobals; |
59 |
2 |
} |
60 |
|
|
61 |
|
public void setWebRequestServicer(WebRequestServicer webRequestServicer) |
62 |
|
{ |
63 |
2 |
_webRequestServicer = webRequestServicer; |
64 |
2 |
} |
65 |
|
} |