Merge branch 'BF-2742' of /home/git/repositories/brainfood/ofbiz-directcontrolservlet
Showing
1 changed file
with
10 additions
and
2 deletions
... | @@ -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); | ... | ... |
-
Please register or sign in to post a comment