struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mr...@apache.org
Subject svn commit: r676181 - in /struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher: Dispatcher.java ng/PrepareOperations.java ng/filter/StrutsPrepareAndExecuteFilter.java ng/filter/StrutsPrepareFilter.java ng/servlet/StrutsServlet.java
Date Sat, 12 Jul 2008 14:40:27 GMT
Author: mrdon
Date: Sat Jul 12 07:40:27 2008
New Revision: 676181

URL: http://svn.apache.org/viewvc?rev=676181&view=rev
Log:
Ensuring action context is setup by prepare dispatcher ahead of action execution
WW-2079

Modified:
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/PrepareOperations.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareAndExecuteFilter.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/servlet/StrutsServlet.java

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java?rev=676181&r1=676180&r2=676181&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
(original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
Sat Jul 12 07:40:27 2008
@@ -488,7 +488,10 @@
         Map application = new ApplicationMap(context);
 
         Map<String,Object> extraContext = createContextMap(requestMap, params, session,
application, request, response, context);
-        extraContext.put(ServletActionContext.ACTION_MAPPING, mapping);
+
+        if (mapping != null) {
+            extraContext.put(ServletActionContext.ACTION_MAPPING, mapping);
+        }
         return extraContext;
     }
 

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/PrepareOperations.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/PrepareOperations.java?rev=676181&r1=676180&r2=676181&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/PrepareOperations.java
(original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/PrepareOperations.java
Sat Jul 12 07:40:27 2008
@@ -58,7 +58,7 @@
     /**
      * Creates the action context and initializes the thread local
      */
-    public ActionContext createActionContext(HttpServletRequest request) {
+    public ActionContext createActionContext(HttpServletRequest request, HttpServletResponse
response) {
         ActionContext ctx;
         Integer counter = 1;
         Integer oldCounter = (Integer) request.getAttribute(CLEANUP_RECURSION_COUNTER);
@@ -72,6 +72,7 @@
             ctx = new ActionContext(new HashMap<String, Object>(oldContext.getContextMap()));
         } else {
             ValueStack stack = dispatcher.getContainer().getInstance(ValueStackFactory.class).createValueStack();
+            stack.getContext().putAll(dispatcher.createContextMap(request, response, null,
servletContext));
             ctx = new ActionContext(stack.getContext());
         }
         request.setAttribute(CLEANUP_RECURSION_COUNTER, counter);

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareAndExecuteFilter.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareAndExecuteFilter.java?rev=676181&r1=676180&r2=676181&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareAndExecuteFilter.java
(original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareAndExecuteFilter.java
Sat Jul 12 07:40:27 2008
@@ -62,7 +62,7 @@
         HttpServletResponse response = (HttpServletResponse) res;
 
         try {
-            prepare.createActionContext(request);
+            prepare.createActionContext(request, response);
             prepare.assignDispatcherToThread();
             prepare.setEncodingAndLocale(request, response);
             request = prepare.wrapRequest(request);

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.java?rev=676181&r1=676180&r2=676181&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.java
(original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.java
Sat Jul 12 07:40:27 2008
@@ -56,7 +56,7 @@
         HttpServletResponse response = (HttpServletResponse) res;
 
         try {
-            prepare.createActionContext(request);
+            prepare.createActionContext(request, response);
             prepare.assignDispatcherToThread();
             prepare.setEncodingAndLocale(request, response);
             request = prepare.wrapRequest(request);

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/servlet/StrutsServlet.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/servlet/StrutsServlet.java?rev=676181&r1=676180&r2=676181&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/servlet/StrutsServlet.java
(original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/servlet/StrutsServlet.java
Sat Jul 12 07:40:27 2008
@@ -63,7 +63,7 @@
     public void service(HttpServletRequest request, HttpServletResponse response) throws
IOException, ServletException {
 
         try {
-            prepare.createActionContext(request);
+            prepare.createActionContext(request, response);
             prepare.assignDispatcherToThread();
             prepare.setEncodingAndLocale(request, response);
             request = prepare.wrapRequest(request);



Mime
View raw message