You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2014/02/19 07:30:06 UTC

[05/14] git commit: Uses the new versions of methods without ServletContext

Uses the new versions of methods without ServletContext


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/4a4d0416
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/4a4d0416
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/4a4d0416

Branch: refs/heads/develop
Commit: 4a4d04164a31dc5b905eca1f345c6d2a26472c30
Parents: a2e97a9
Author: Lukasz Lenart <lu...@apache.org>
Authored: Mon Feb 17 09:33:38 2014 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Mon Feb 17 09:33:38 2014 +0100

----------------------------------------------------------------------
 .../struts2/components/ActionComponent.java     | 41 +++++++++-----------
 .../org/apache/struts2/views/jsp/TagUtils.java  | 23 +++++------
 2 files changed, 28 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/4a4d0416/core/src/main/java/org/apache/struts2/components/ActionComponent.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/components/ActionComponent.java b/core/src/main/java/org/apache/struts2/components/ActionComponent.java
index 5eb7035..f184454 100644
--- a/core/src/main/java/org/apache/struts2/components/ActionComponent.java
+++ b/core/src/main/java/org/apache/struts2/components/ActionComponent.java
@@ -21,17 +21,15 @@
 
 package org.apache.struts2.components;
 
-import java.io.IOException;
-import java.io.Writer;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.jsp.PageContext;
-
+import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.ActionInvocation;
+import com.opensymphony.xwork2.ActionProxy;
+import com.opensymphony.xwork2.ActionProxyFactory;
+import com.opensymphony.xwork2.inject.Inject;
+import com.opensymphony.xwork2.util.ValueStack;
+import com.opensymphony.xwork2.util.ValueStackFactory;
+import com.opensymphony.xwork2.util.logging.Logger;
+import com.opensymphony.xwork2.util.logging.LoggerFactory;
 import org.apache.struts2.ServletActionContext;
 import org.apache.struts2.StrutsException;
 import org.apache.struts2.StrutsStatics;
@@ -43,15 +41,14 @@ import org.apache.struts2.views.annotations.StrutsTag;
 import org.apache.struts2.views.annotations.StrutsTagAttribute;
 import org.apache.struts2.views.jsp.TagUtils;
 
-import com.opensymphony.xwork2.ActionContext;
-import com.opensymphony.xwork2.ActionProxy;
-import com.opensymphony.xwork2.ActionProxyFactory;
-import com.opensymphony.xwork2.ActionInvocation;
-import com.opensymphony.xwork2.inject.Inject;
-import com.opensymphony.xwork2.util.ValueStack;
-import com.opensymphony.xwork2.util.ValueStackFactory;
-import com.opensymphony.xwork2.util.logging.Logger;
-import com.opensymphony.xwork2.util.logging.LoggerFactory;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.PageContext;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
 
 /**
  * <!-- START SNIPPET: javadoc -->
@@ -188,7 +185,6 @@ public class ActionComponent extends ContextBean {
         Map newParams = createParametersForContext();
 
         ActionContext ctx = new ActionContext(stack.getContext());
-        ServletContext servletContext = (ServletContext) ctx.get(ServletActionContext.SERVLET_CONTEXT);
         PageContext pageContext = (PageContext) ctx.get(ServletActionContext.PAGE_CONTEXT);
         Map session = ctx.getSession();
         Map application = ctx.getApplication();
@@ -199,8 +195,7 @@ public class ActionComponent extends ContextBean {
                 session,
                 application,
                 req,
-                res,
-                servletContext);
+                res);
 
         ValueStack newStack = valueStackFactory.createValueStack(stack);
         extraContext.put(ActionContext.VALUE_STACK, newStack);

http://git-wip-us.apache.org/repos/asf/struts/blob/4a4d0416/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java b/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java
index a4a2848..ab7abea 100644
--- a/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java
+++ b/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java
@@ -21,12 +21,11 @@
 
 package org.apache.struts2.views.jsp;
 
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.jsp.PageContext;
-
+import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.ActionInvocation;
+import com.opensymphony.xwork2.config.ConfigurationException;
+import com.opensymphony.xwork2.util.ValueStack;
+import com.opensymphony.xwork2.util.ValueStackFactory;
 import org.apache.struts2.RequestUtils;
 import org.apache.struts2.ServletActionContext;
 import org.apache.struts2.dispatcher.ApplicationMap;
@@ -37,11 +36,10 @@ import org.apache.struts2.dispatcher.mapper.ActionMapper;
 import org.apache.struts2.dispatcher.mapper.ActionMapping;
 import org.apache.struts2.util.AttributeMap;
 
-import com.opensymphony.xwork2.ActionContext;
-import com.opensymphony.xwork2.ActionInvocation;
-import com.opensymphony.xwork2.config.ConfigurationException;
-import com.opensymphony.xwork2.util.ValueStack;
-import com.opensymphony.xwork2.util.ValueStackFactory;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.PageContext;
+import java.util.Map;
 
 
 /**
@@ -67,8 +65,7 @@ public class TagUtils {
                     new SessionMap(req),
                     new ApplicationMap(pageContext.getServletContext()),
                     req,
-                    res,
-                    pageContext.getServletContext());
+                    res);
             extraContext.put(ServletActionContext.PAGE_CONTEXT, pageContext);
             stack.getContext().putAll(extraContext);
             req.setAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY, stack);