Browse Source

Update VoovanTFB.java (#5891)

* Update VoovanTFB.java

* Update VoovanTFB.java
hely ho 5 years ago
parent
commit
6da4610f3d
1 changed files with 3 additions and 4 deletions
  1. 3 4
      frameworks/Java/voovan/src/main/java/org/voovan/VoovanTFB.java

+ 3 - 4
frameworks/Java/voovan/src/main/java/org/voovan/VoovanTFB.java

@@ -11,6 +11,7 @@ import org.voovan.tools.TEnv;
 import org.voovan.tools.TObject;
 import org.voovan.tools.json.JSON;
 import org.voovan.tools.log.Logger;
+import org.voovan.tools.TString;
 import org.voovan.tools.reflect.TReflect;
 
 import java.io.IOException;
@@ -34,9 +35,7 @@ public class VoovanTFB {
                         return message;
                 }
         }
-
-        private static final Message msg = new Message(HELLO_WORLD_STR);
-
+        
         public static void main(String[] args) {
                 TReflect.register(Message.class);
 
@@ -65,7 +64,7 @@ public class VoovanTFB {
                 webServer.get("/json", new HttpRouter() {
                         public void process(HttpRequest req, HttpResponse resp) throws Exception {
                                 resp.header().put(HttpStatic.CONTENT_TYPE_STRING, HttpStatic.APPLICATION_JSON_STRING);
-                                resp.write(JSON.toJSON(msg, false, false));
+                                resp.write(TString.toAsciiBytes(JSON.toJSON(new Message(HELLO_WORLD_STR), false, false)));
                         }
                 });