struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roman Shevchenko (JIRA)" <j...@apache.org>
Subject [jira] Created: (WW-3075) StrutsPrepareAndExecuteFilter accesses request parameters before setting request encoding
Date Sun, 05 Apr 2009 14:24:06 GMT
StrutsPrepareAndExecuteFilter accesses request parameters before setting request encoding
-----------------------------------------------------------------------------------------

                 Key: WW-3075
                 URL: https://issues.apache.org/struts/browse/WW-3075
             Project: Struts 2
          Issue Type: Bug
          Components: Dispatch Filter
    Affects Versions: 2.1.6
            Reporter: Roman Shevchenko


In StrutsPrepareAndExecuteFilter.doFilter(), method PrepareOperations.createActionContext()
is called before PrepareOperations.setEncodingAndLocale() one. This causes population of value
stack with incorrect data. Same problem exists in StrutsPrepareFilter.

Suggested patch:
--- StrutsPrepareAndExecuteFilter.java	Mon Jan 05 20:00:24 2009
+++ StrutsPrepareAndExecuteFilter.java	Sun Apr 05 18:01:18 2009
@@ -62,9 +62,9 @@
         HttpServletResponse response = (HttpServletResponse) res;
 
         try {
+            prepare.setEncodingAndLocale(request, response);
             prepare.createActionContext(request, response);
             prepare.assignDispatcherToThread();
-            prepare.setEncodingAndLocale(request, response);
             request = prepare.wrapRequest(request);
             ActionMapping mapping = prepare.findActionMapping(request, response);
             if (mapping == null) {

--- StrutsPrepareFilter.java	Mon Jan 05 20:00:24 2009
+++ StrutsPrepareFilter.java	Sun Apr 05 18:01:34 2009
@@ -56,9 +56,9 @@
         HttpServletResponse response = (HttpServletResponse) res;
 
         try {
+            prepare.setEncodingAndLocale(request, response);
             prepare.createActionContext(request, response);
             prepare.assignDispatcherToThread();
-            prepare.setEncodingAndLocale(request, response);
             request = prepare.wrapRequest(request);
             prepare.findActionMapping(request, response);
 


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message