aboutsummaryrefslogtreecommitdiff
path: root/juick-ws/src/main/java/com/juick/ws/StatusController.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-07-25 21:36:50 +0300
committerGravatar Vitaly Takmazov2016-07-27 13:56:09 +0300
commit69af3f60d399157a8951988fa2f91d29c553fbb5 (patch)
tree8c38def00d1b3dc5e38cf421870afb62f3a823ea /juick-ws/src/main/java/com/juick/ws/StatusController.java
parent94c0d43d2765488d715bffe426934ed7caa8f4f2 (diff)
juick-ws: websocket terminal
Diffstat (limited to 'juick-ws/src/main/java/com/juick/ws/StatusController.java')
-rw-r--r--juick-ws/src/main/java/com/juick/ws/StatusController.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/juick-ws/src/main/java/com/juick/ws/StatusController.java b/juick-ws/src/main/java/com/juick/ws/StatusController.java
index b212af19..9c3e2404 100644
--- a/juick-ws/src/main/java/com/juick/ws/StatusController.java
+++ b/juick-ws/src/main/java/com/juick/ws/StatusController.java
@@ -4,6 +4,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
import javax.inject.Inject;
@@ -17,7 +18,11 @@ public class StatusController {
WebsocketComponent wsHandler;
@RequestMapping(method = RequestMethod.GET, headers = "Connection!=Upgrade", value = "/")
- public String status() {
- return String.format("Clients: %d", wsHandler.clients.size());
+ public ModelAndView status() {
+ ModelAndView modelAndView = new ModelAndView();
+ modelAndView.addObject("clients", wsHandler.clients.size());
+ modelAndView.setViewName("index");
+ return modelAndView;
}
+
}