Browse Source

use Echo handler for /plaintext test

Gelin Luo 8 years ago
parent
commit
5bd15a5d59

+ 3 - 8
frameworks/Java/act/src/main/java/com/techempower/act/controller/HelloController.java

@@ -5,22 +5,17 @@ import org.osgl.mvc.annotation.GetAction;
 import org.osgl.mvc.annotation.SessionFree;
 import org.osgl.mvc.annotation.SessionFree;
 
 
 import javax.inject.Singleton;
 import javax.inject.Singleton;
+import java.io.File;
 
 
 @Singleton
 @Singleton
 final class HelloController extends Controller.Util {
 final class HelloController extends Controller.Util {
 
 
     private static final String HELLO_WORLD = "Hello, World!";
     private static final String HELLO_WORLD = "Hello, World!";
 
 
-	@GetAction("/json")
+    @GetAction("/json")
     @SessionFree
     @SessionFree
     public void json() throws Exception {
     public void json() throws Exception {
-        json(new Message("Hello, World!"));
-    }
-
-    @GetAction("/plaintext")
-    @SessionFree
-    public void plaintext() {
-        text(HELLO_WORLD);
+        json(new Message(HELLO_WORLD));
     }
     }
 
 
     public static final class Message {
     public static final class Message {

+ 1 - 0
frameworks/Java/act/src/main/resources/routes.conf

@@ -0,0 +1 @@
+GET /plaintext echo: Hello World!