Author: nilsga
Date: Sat Dec  6 11:32:29 2008
New Revision: 724030

URL: http://svn.apache.org/viewvc?rev=724030&view=rev
Log:
WW-2800 Added setters for response, request and context. 

Modified:
    
struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/context/PortletActionContext.java

Modified: 
struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/context/PortletActionContext.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/context/PortletActionContext.java?rev=724030&r1=724029&r2=724030&view=diff
==============================================================================
--- 
struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/context/PortletActionContext.java
 (original)
+++ 
struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/context/PortletActionContext.java
 Sat Dec  6 11:32:29 2008
@@ -129,6 +129,14 @@
     public static PortletRequest getRequest() {
         return (PortletRequest) getContext().get(REQUEST);
     }
+    
+    /**
+     * Convenience setter for the portlet request.
+     * @param request
+     */
+    public static void setRequest(PortletRequest request) {
+       getContext().put(REQUEST, request);
+    }
 
     /**
      * Get the current PortletResponse
@@ -138,6 +146,14 @@
     public static PortletResponse getResponse() {
         return (PortletResponse) getContext().get(RESPONSE);
     }
+    
+    /**
+     * Convenience setter for the portlet response.
+     * @param response
+     */
+    public static void setResponse(PortletResponse response) {
+       getContext().put(RESPONSE, response);
+    }
 
     /**
      * Get the phase that the portlet is executing in.
@@ -206,6 +222,14 @@
     }
     
     /**
+     * Convenience setter for the portlet context.
+     * @param context
+     */
+    public static void setPortletContext(PortletContext context) {
+       getContext().put(StrutsStatics.STRUTS_PORTLET_CONTEXT, context);
+    }
+    
+    /**
      * Gets the action mapping for this context
      *
      * @return The action mapping


Reply via email to