1 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 ; 14 15 21 public class PortletActionContext extends ActionContext implements WebWorkPortletStatics { 22 23 24 public PortletActionContext(Map 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 getApplicationContextScopeSession() { 41 return (Map ) ActionContext.getContext().get(APPLICATION_SCOPE_SESSION); 42 } 43 44 public static PortletSession getPortletSession() { 45 return getPortletRequest().getPortletSession(); 46 } 47 48 49 } | Popular Tags |