15b9531c by Jerry Pommer

Merge branch 'BF-2742' of /home/git/repositories/brainfood/ofbiz-directcontrolservlet

2 parents ce3f4f2b 61cdbe88
...@@ -18,6 +18,7 @@ import java.util.HashSet; ...@@ -18,6 +18,7 @@ import java.util.HashSet;
18 import java.util.Enumeration; 18 import java.util.Enumeration;
19 import java.util.Locale; 19 import java.util.Locale;
20 import java.util.TimeZone; 20 import java.util.TimeZone;
21 import java.util.Iterator;
21 22
22 import javolution.util.FastList; 23 import javolution.util.FastList;
23 24
...@@ -112,13 +113,20 @@ public class DirectControlServlet extends HttpServlet { ...@@ -112,13 +113,20 @@ public class DirectControlServlet extends HttpServlet {
112 Map<String, Object> context = new HashMap<String, Object>(); 113 Map<String, Object> context = new HashMap<String, Object>();
113 String authToken = null; 114 String authToken = null;
114 115
116 String paramList = "";
117 for (Iterator<String> k = request.getParameterMap().keySet().iterator(); k.hasNext(); ) {
118 paramList += " " + k.next();
119 }
120
115 Debug.logInfo("PARAMETERS: " + request.getParameterMap(), module); 121 Debug.logInfo("PARAMETERS: " + request.getParameterMap(), module);
116 // Handle if this is a form post 122 // Handle if this is a form post
117 String contentType = request.getContentType(); 123 String contentType = request.getContentType();
118 if (contentType != null && contentType.indexOf("x-www-form-urlencoded") != -1) { 124 if (contentType != null && contentType.indexOf("x-www-form-urlencoded") != -1) {
119 method = request.getParameter("_method"); 125 method = request.getParameter("_method");
120 Debug.logInfo("Method: " + method, module); 126 String httpMethod = request.getMethod();
121 if (method == null) method = "POST"; 127 if (method == null && httpMethod != null) method = httpMethod;
128 Debug.logInfo("Method: HTTP(" + httpMethod + ") embedded(" + method + ")", module);
129 if (method == null) method = "GET";
122 // If this is a backbone PUT/DELETE emulated call then handle it 130 // If this is a backbone PUT/DELETE emulated call then handle it
123 if ("PUT".equals(method) || "DELETE".equals(method) || "CALL".equals(method) || "POST".equals(method)) { 131 if ("PUT".equals(method) || "DELETE".equals(method) || "CALL".equals(method) || "POST".equals(method)) {
124 // if (!"CALL".equals(method)) context.put("_method", method); 132 // if (!"CALL".equals(method)) context.put("_method", method);
......