Permalink
Browse files

chat code complete clean-up

  • Loading branch information...
1 parent a01e709 commit 92fa73b1561830a237fcefdbd99f143f258d6488 mic committed Mar 3, 2013
View
@@ -100,7 +100,7 @@
</resource>
<resource>
<directory>src/main/webapp</directory>
- <targetPath>../webapp</targetPath>
+ <targetPath>webapp</targetPath>
</resource>
</resources>
Binary file not shown.
@@ -14,11 +14,13 @@
{
public static void main(String[] args) throws Exception
{
+ String webDir = WebServer.class.getClassLoader().getResource("webapp").toExternalForm();
+
Server server = new Server(8080);
WebAppContext context = new WebAppContext();
- context.setDescriptor("webapp/WEB-INF/web.xml");
- context.setResourceBase("webapp");
+ context.setResourceBase(webDir);
+ //context.setDescriptor(webDir + "/WEB-INF/web.xml");
context.setContextPath("/");
context.setParentLoaderPriority(true);
@@ -207,15 +207,10 @@ public void putRecord(JSONObject record) {
try {
String id = record.getString("id");
JSONObject old = records.get(id);
- if (old != null) {
- if (record.getString("version")
- .compareTo(old.getString("version")) < 0) {
- return;
- }
- String prev = old.getString("uri");
- record.put("prev", prev);
+ if (old == null || record.getString("version")
+ .compareTo(old.getString("version")) > 0) {
+ records.put(id, record);
}
- records.put(id, record);
} catch (JSONException e1) {
e1.printStackTrace();
}

0 comments on commit 92fa73b

Please sign in to comment.