package com.lance.websocket.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class IndexController {

	/**
	 * Index
	 * @return
	 */
	@RequestMapping(value={"", "/", "index"})
	public String index() {
		return "index.jsp";
	}
	
	@RequestMapping("chat")
	public String chat() {
		return "chat.jsp";
	}
	
	@RequestMapping("game")
	public String game() {
		return "index.jsp";
	}
}

@@ -58,137 +58,542 @@
 ork.
-stereotype.Controller;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0A%0A@Controller%0Apublic class IndexController %7B
+beans.factory.annotation.Autowired;%0Aimport org.springframework.http.HttpStatus;%0Aimport org.springframework.http.ResponseEntity;%0Aimport org.springframework.messaging.simp.SimpMessagingTemplate;%0Aimport org.springframework.stereotype.Controller;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0Aimport org.springframework.web.bind.annotation.RequestMethod;%0Aimport org.springframework.web.bind.annotation.ResponseBody;%0A%0A@Controller%0Apublic class IndexController %7B%0A%09@Autowired%0A%09private SimpMessagingTemplate messagingTemplate;
 %0A%0A%09/
@@ -605,16 +605,21 @@
 * Index%0A
+%09 * %0A
 %09 * @ret
@@ -653,10 +653,13 @@
 alue
-=%7B
+ = %7B 
 %22%22, 
@@ -670,16 +670,17 @@
  %22index%22
+ 
 %7D)%0A%09publ
@@ -716,33 +716,32 @@
 %22index.jsp%22;%0A%09%7D%0A
-%09
 %0A%09@RequestMappin
@@ -802,79 +802,272 @@
 %0A%09%7D%0A
-%09%0A%09@RequestMapping(%22game%22)%0A%09public String game() %7B%0A%09%09return %22index.jsp%22
+%0A%09/**%0A%09 * %E5%8F%91%E9%80%81%E6%B6%88%E6%81%AF%0A%09 * @return%0A%09 */%0A%09@ResponseBody%0A%09@RequestMapping(value = %22/sendMessage%22, method = RequestMethod.POST)%0A%09public ResponseEntity%3C?%3E sendMessage() %7B%0A%09%09messagingTemplate.convertAndSend(%22/queue/notify%22, %22test%22);%0A%09%09return new ResponseEntity%3C%3E(HttpStatus.OK)
 ;%0A%09%7D

update indexcontroller