package com.lance.websocket.client.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";
	}
}

@@ -45,430 +45,1468 @@
 ort 
-org.springframework.stereotype.Controller;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0A%0A@Controller%0Apublic class IndexController %7B%0A%0A%09/**%0A%09 * Index%0A%09 * @return%0A%09 */%0A%09@RequestMapping(value=%7B%22%22, %22/%22, %22index%22%7D)%0A%09public String index() %7B%0A%09%09return %22index.jsp%22;%0A%09%7D%0A%09%0A%09@RequestMapping(%22chat%22)%0A%09public String chat() %7B%0A%09%09return %22chat.jsp%22;%0A%09%7D%0A%09%0A%09@RequestMapping(%22game%22)%0A%09public String game() %7B%0A%09%09return %22index.jsp%22
+java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport org.springframework.beans.factory.annotation.Autowired;%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/**%0A%09 * Index%0A%09 * @return%0A%09 */%0A%09@RequestMapping(value=%7B%22%22, %22/%22, %22index%22%7D)%0A%09public String index() %7B%0A%09%09return %22index.jsp%22;%0A%09%7D%0A%09%0A%09@RequestMapping(%22chat%22)%0A%09public String chat() %7B%0A%09%09return %22chat.jsp%22;%0A%09%7D%0A%09%0A%09@RequestMapping(%22notifications%22)%0A%09public String notifications() %7B%0A%09%09return %22notifications.jsp%22;%0A%09%7D%0A%09%0A%09@RequestMapping(%22notifications-button%22)%0A%09public String notificationsButton() %7B%0A%09%09return %22notifications-buttion.jsp%22;%0A%09%7D%0A%09%0A%09@ResponseBody%0A%09@RequestMapping(value = %22/sendMessage%22, method = RequestMethod.POST)%0A%09public void sendMessage() %7B%0A%09%09List%3CMessageInfo%3E messages = getMessage();%0A%09%09messagingTemplate.convertAndSend(%22/user/topic/message%22, messages);%0A%09%7D%0A%09%0A%09private List%3CMessageInfo%3E getMessage()%7B%0A%09%09List%3CMessageInfo%3E list = new ArrayList%3C%3E();%0A%09%09list.add(new MessageInfo(%22Message-Text1%22));%0A%09%09list.add(new MessageInfo(%22Message-Text2%22));%0A%09%09list.add(new MessageInfo(%22Message-Text3%22));%0A%09%09list.add(new MessageInfo(%22Message-Text4%22));%0A%09%09return list
 ;%0A%09%7D

add requestmap method