You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by mr...@apache.org on 2006/10/09 22:49:27 UTC

svn commit: r454501 - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/StrutsRequestWrapper.java

Author: mrdon
Date: Mon Oct  9 13:49:26 2006
New Revision: 454501

URL: http://svn.apache.org/viewvc?view=rev&rev=454501
Log:
Slightly optimize servlet request wrapper
WW-1453

Modified:
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/StrutsRequestWrapper.java

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/StrutsRequestWrapper.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/StrutsRequestWrapper.java?view=diff&rev=454501&r1=454500&r2=454501
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/StrutsRequestWrapper.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/StrutsRequestWrapper.java Mon Oct  9 13:49:26 2006
@@ -57,10 +57,11 @@
             return super.getAttribute(s);
         }
 
+        ActionContext ctx = ActionContext.getContext();
         Object attribute = super.getAttribute(s);
 
         boolean alreadyIn = false;
-        Boolean b = (Boolean) ActionContext.getContext().get("__requestWrapper.getAttribute");
+        Boolean b = (Boolean) ctx.get("__requestWrapper.getAttribute");
         if (b != null) {
             alreadyIn = b.booleanValue();
         }
@@ -70,13 +71,13 @@
         if (!alreadyIn && attribute == null && s.indexOf("#") == -1) {
             try {
                 // If not found, then try the ValueStack
-                ActionContext.getContext().put("__requestWrapper.getAttribute", Boolean.TRUE);
-                ValueStack stack = ActionContext.getContext().getValueStack();
+                ctx.put("__requestWrapper.getAttribute", Boolean.TRUE);
+                ValueStack stack = ctx.getValueStack();
                 if (stack != null) {
                     attribute = stack.findValue(s);
                 }
             } finally {
-                ActionContext.getContext().put("__requestWrapper.getAttribute", Boolean.FALSE);
+                ctx.put("__requestWrapper.getAttribute", Boolean.FALSE);
             }
         }
         return attribute;