89455a4a by bank

change JSON lib package path for lastest version of OFBIZ

1 parent 93372177
......@@ -57,10 +57,8 @@ import org.ofbiz.service.DispatchContext;
import org.ofbiz.service.LocalDispatcher;
import org.ofbiz.service.ModelService;
import org.ofbiz.service.ServiceContainer;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVRecord;
import org.apache.commons.fileupload.*;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItem;
......@@ -70,11 +68,13 @@ import groovy.lang.GroovyClassLoader;
import groovy.lang.Script;
import org.codehaus.groovy.runtime.InvokerHelper;
import org.ofbiz.base.json.JSON;
import org.ofbiz.base.conversion.JSONConverters.JSONToMap;
import org.ofbiz.base.lang.JSON;
import net.sf.json.JSONObject;
import net.sf.json.JsonConfig;
import net.sf.json.processors.JsonValueProcessor;
import net.sf.json.JSONSerializer;
public class DirectControlServlet extends HttpServlet {
public static final String module = DirectControlServlet.class.getName();
......@@ -159,8 +159,9 @@ public class DirectControlServlet extends HttpServlet {
if ("application/json".equals(contentType)) {
// Read request body as JSON and insert into the context
JSON json = new JSON(request.getReader());
Map<String,Object> items = json.JSONObject();
JSON json = JSON.from(request.getReader());
JSONToMap jsonMap = new JSONToMap();
Map<String,Object> items = jsonMap.convert(json);
for (String key : items.keySet()) {
context.put(key, items.get(key));
}
......@@ -200,8 +201,9 @@ public class DirectControlServlet extends HttpServlet {
// Check if the request is a backbone style "emulateJSON" request
if (contentType != null && contentType.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")));
Map<String,Object> items = json.JSONObject();
JSON json = JSON.from(new StringReader(request.getParameter("model")));
JSONToMap jsonMap = new JSONToMap();
Map<String,Object> items = jsonMap.convert(json);
for (String key : items.keySet()) {
if (!"sessionId".equals(key)) {
context.put(key, items.get(key));
......