Browse Source

verify Fixed servlet-raw's db test

Mike Smith 11 years ago
parent
commit
225f8083de
1 changed files with 8 additions and 1 deletions
  1. 8 1
      servlet/src/main/java/hello/DbPoolServlet.java

+ 8 - 1
servlet/src/main/java/hello/DbPoolServlet.java

@@ -88,7 +88,14 @@ public class DbPoolServlet extends HttpServlet
     // Write JSON encoded message to the response.
     try
     {
-      Common.MAPPER.writeValue(res.getOutputStream(), worlds);
+      if (count == 1)
+      {
+        Common.MAPPER.writeValue(res.getOutputStream(), worlds[0]); 
+      }
+      else
+      {
+        Common.MAPPER.writeValue(res.getOutputStream(), worlds);
+      }
     }
     catch (IOException ioe) 
     {