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 {
String httpMethod = request.getMethod();
if (method == null && httpMethod != null) method = httpMethod;
if (method == null) method = "GET";
Debug.logInfo("Method: HTTP(" + httpMethod + ") embedded(" + method + ")", module);
// Load context
Map<String, Object> context = new HashMap<String, Object>();
......@@ -130,8 +129,7 @@ public class DirectControlServlet extends HttpServlet {
}
} else {
// Check if the request is a backbone style "emulateJSON" request
Debug.logInfo("MODEL: " + request.getParameter("model"), module);
if (request.getContentType().indexOf("x-www-form-urlencoded") > 0 &&
if (request.getContentType().indexOf("x-www-form-urlencoded") != -1 &&
request.getParameter("model") != null) {
Debug.logInfo("MODEL: " + request.getParameter("model"), module);
JSON json = new JSON(new StringReader(request.getParameter("model")));
......