aboutsummaryrefslogtreecommitdiff
path: root/juick-ws/src/main/java/com/juick/ws/StatusController.java
diff options
context:
space:
mode:
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;
}
+
}