openamf/src/java/org/openamf RequestContext.java,1.3,1.4

Sean Sullivan <[email protected]> Sat, 18 Sep 2004 02:52:24 +0000
Newsgroups gmane.comp.java.openamf.cvs
Message-ID <[email protected]>
Update of /cvsroot/openamf/openamf/src/java/org/openamf
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18456/src/java/org/openamf

Modified Files:
	RequestContext.java 
Log Message:
added getter and setter for HttpServletResponse object.
Feature Request #1028245.

Index: RequestContext.java
===================================================================
RCS file: /cvsroot/openamf/openamf/src/java/org/openamf/RequestContext.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** RequestContext.java	10 Jun 2004 01:20:59 -0000	1.3
--- RequestContext.java	18 Sep 2004 02:52:21 -0000	1.4
***************
*** 9,12 ****
--- 9,13 ----
  
  import javax.servlet.http.HttpServletRequest;
+ import javax.servlet.http.HttpServletResponse;
  import javax.servlet.http.HttpSession;
  
***************
*** 14,18 ****
   *
   * This class allows web applications to 
!  * easily access the HttpServletRequest object.
   *
   * OpenAMF's RequestContext class was inspired by the example code 
--- 15,19 ----
   *
   * This class allows web applications to 
!  * easily access the HttpServletRequest and HttpServletResponse objects.
   *
   * OpenAMF's RequestContext class was inspired by the example code 
***************
*** 33,36 ****
--- 34,38 ----
  {
  	static private ThreadLocal httpRequestLocal = new ThreadLocal();
+ 	static private ThreadLocal httpResponseLocal = new ThreadLocal();
  	static private ThreadLocal requestMsgLocal = new ThreadLocal();
  	
***************
*** 51,55 ****
      	httpRequestLocal.set(req);
      }
!     
      /** 
       * 
--- 53,69 ----
      	httpRequestLocal.set(req);
      }
! 
!     /**
!      *  
!      * @param resp the servlet response object
!      * 
!      * @see #getHttpServletResponse()
!      * 
!      */
!     static public void setHttpServletResponse(HttpServletResponse resp)
! 	{
!     	httpResponseLocal.set(resp);
!     }
! 
      /** 
       * 
***************
*** 60,63 ****
--- 74,78 ----
  	{
      	httpRequestLocal.set(null);
+     	httpResponseLocal.set(null);
      	requestMsgLocal.set(null);
      }
***************
*** 76,80 ****
--- 91,110 ----
      	return req;
      }
+ 
+     /**
+      * 
+      * 
+      * @return may return null
+      * 
+      * @see #setHttpServletResponse(HttpServletResponse)
+      * 
+      */
+     static public HttpServletResponse getHttpServletResponse()
+ 	{
+     	HttpServletResponse resp = (HttpServletResponse) httpResponseLocal.get();
+     	return resp;
+     }
      
+ 
      /**
       *  



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php