From 1417c22823c579ed83f2e3b34b2ab033a42a90b3 Mon Sep 17 00:00:00 2001 From: Kalle Stenflo Date: Mon, 8 Sep 2014 11:37:27 +0200 Subject: [PATCH] Load webapp from disk. --- .../main/java/com/jayway/jsonpath/web/boot/Main.java | 11 ++++++----- .../com/jayway/jsonpath/internal/PathFormalizer.java | 10 ---------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/json-path-web-test/src/main/java/com/jayway/jsonpath/web/boot/Main.java b/json-path-web-test/src/main/java/com/jayway/jsonpath/web/boot/Main.java index c9c44a7f..44ecb6a0 100644 --- a/json-path-web-test/src/main/java/com/jayway/jsonpath/web/boot/Main.java +++ b/json-path-web-test/src/main/java/com/jayway/jsonpath/web/boot/Main.java @@ -43,12 +43,13 @@ public class Main { WebAppContext webAppContext = new WebAppContext(); webAppContext.setServer(server); webAppContext.setContextPath("/"); - //if(config.resourceBase().startsWith("classpath")){ - webAppContext.setResourceBase(Main.class.getResource("/webapp").toExternalForm()); - //} else { - // webAppContext.setResourceBase(config.resourceBase()); - //} + String resourceBase = System.getProperty("resourceBase"); + if(resourceBase != null){ + webAppContext.setResourceBase(resourceBase); + } else { + webAppContext.setResourceBase(Main.class.getResource("/webapp").toExternalForm()); + } HandlerList handlers = new HandlerList(); handlers.setHandlers(new Handler[]{context, webAppContext}); diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/PathFormalizer.java b/json-path/src/main/java/com/jayway/jsonpath/internal/PathFormalizer.java index bb6a7641..1e7c630e 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/internal/PathFormalizer.java +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/PathFormalizer.java @@ -63,7 +63,6 @@ public class PathFormalizer extends Parser { buffer.flush(); } for (Fragment f : buffer.getFragments()) { - System.out.println("Fragment: " + f.frag + " Type: " + f.type); formalized.append(f.toString()); } return formalized.toString(); @@ -177,15 +176,6 @@ public class PathFormalizer extends Parser { INDEX } - public static void main(String[] args) { - String path = "$.store['foo'].arr[10].monkey..book[?(@.isbn)].isbn"; - System.out.println(path); - PathFormalizer p = new PathFormalizer(path); - String f = p.formalize(); - System.out.println(f); - - - } }