69feb1c7 by Adam Heath

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

2 parents 6ad55ef2 2fcd48e3
...@@ -117,7 +117,6 @@ public class DirectControlServlet extends HttpServlet { ...@@ -117,7 +117,6 @@ public class DirectControlServlet extends HttpServlet {
117 String httpMethod = request.getMethod(); 117 String httpMethod = request.getMethod();
118 if (method == null && httpMethod != null) method = httpMethod; 118 if (method == null && httpMethod != null) method = httpMethod;
119 if (method == null) method = "GET"; 119 if (method == null) method = "GET";
120 Debug.logInfo("Method: HTTP(" + httpMethod + ") embedded(" + method + ")", module);
121 120
122 // Load context 121 // Load context
123 Map<String, Object> context = new HashMap<String, Object>(); 122 Map<String, Object> context = new HashMap<String, Object>();
...@@ -130,8 +129,7 @@ public class DirectControlServlet extends HttpServlet { ...@@ -130,8 +129,7 @@ public class DirectControlServlet extends HttpServlet {
130 } 129 }
131 } else { 130 } else {
132 // Check if the request is a backbone style "emulateJSON" request 131 // Check if the request is a backbone style "emulateJSON" request
133 Debug.logInfo("MODEL: " + request.getParameter("model"), module); 132 if (request.getContentType().indexOf("x-www-form-urlencoded") != -1 &&
134 if (request.getContentType().indexOf("x-www-form-urlencoded") > 0 &&
135 request.getParameter("model") != null) { 133 request.getParameter("model") != null) {
136 Debug.logInfo("MODEL: " + request.getParameter("model"), module); 134 Debug.logInfo("MODEL: " + request.getParameter("model"), module);
137 JSON json = new JSON(new StringReader(request.getParameter("model"))); 135 JSON json = new JSON(new StringReader(request.getParameter("model")));
......