Anonymous avatar Anonymous committed 7e292fe

Issue number: WW-628
Obtained from:
Submitted by:
Reviewed by:
Added work-around for weblogic request parameter handling.

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@519 573baa09-0c28-0410-bef9-dab3c582ae83

Comments (0)

Files changed (1)

src/java/com/opensymphony/webwork/dispatcher/ServletDispatcher.java

 
     // Path to save uploaded files to (this is configurable).
     String saveDir;
+    
+    boolean paramsWorkaroundEnabled = false;
 
     //~ Methods ////////////////////////////////////////////////////////////////
 
 
         // store a reference to ourself into the SessionContext so that we can generate a PageContext
         config.getServletContext().setAttribute("webwork.servlet", this);
+        
+        // test wether param-access workaround needs to be enabled
+        if(config.getServletContext().getServerInfo().indexOf("WebLogic") >= 0) {
+            log.info("WebLogic server detected. Enabling parameter access work-around.");
+            paramsWorkaroundEnabled = true;
+        }
+        else {
+            log.debug("Parameter access work-around disabled.");
+        }
     }
 
     /**
      */
     public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException {
         try {
+            if(paramsWorkaroundEnabled)
+                request.getParameter("foo"); // simply read any parameter (existing or not) to "prime" the request
+	   
             request = wrapRequest(request);
             serviceAction(request, response, getNameSpace(request), getActionName(request), getRequestMap(request), getParameterMap(request), getSessionMap(request), getApplicationMap());
         } catch (IOException e) {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.