KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > webwork > portlet > context > PortletActionContext


1 /*
2  * Copyright (c) 2005 Opensymphony. All Rights Reserved.
3  */

4 package com.opensymphony.webwork.portlet.context;
5
6 import com.opensymphony.webwork.portlet.WebWorkPortletStatics;
7 import com.opensymphony.xwork.ActionContext;
8
9 import javax.portlet.PortletContext;
10 import javax.portlet.PortletRequest;
11 import javax.portlet.PortletResponse;
12 import javax.portlet.PortletSession;
13 import java.util.Map JavaDoc;
14
15 /**
16  * PorletActionContext only in WebWork Framework scope.
17  *
18  * @author <a HREF="mailto:hu_pengfei@yahoo.com.cn">Henry Hu </a>
19  * @since 2005-7-18
20  */

21 public class PortletActionContext extends ActionContext implements WebWorkPortletStatics {
22
23
24     public PortletActionContext(Map JavaDoc context) {
25         super(context);
26     }
27
28     public static PortletRequest getPortletRequest() {
29         return (PortletRequest) ActionContext.getContext().get(PORTLET_REQUEST);
30     }
31
32     public static PortletResponse getPortletResponse() {
33         return (PortletResponse) ActionContext.getContext().get(PORTLET_RESPONSE);
34     }
35
36     public static PortletContext getPortletContext() {
37         return (PortletContext) ActionContext.getContext().get(PORTLET_CONTEXT);
38     }
39
40     public static Map JavaDoc getApplicationContextScopeSession() {
41         return (Map JavaDoc) ActionContext.getContext().get(APPLICATION_SCOPE_SESSION);
42     }
43
44     public static PortletSession getPortletSession() {
45         return getPortletRequest().getPortletSession();
46     }
47
48
49 }
Popular Tags