public static void refreshMessages() {
    	String lastMsg = Session.current().get("lastMsg");
    	ChatRoom chatRoom = getCurrentChatRoom();
    	if ( chatRoom == null )
    		return; //do something here ...
    	Date lastDate = new Date();
    	DateFormat formatter = new SimpleDateFormat(DATE_FORMAT);

    	Session.current().put("lastMsg", formatter.format(new Date()));
    	if ( lastMsg != null && !lastMsg.isEmpty() ) {
    		try {
				lastDate = formatter.parse(lastMsg);
			} catch (ParseException e) {
				e.printStackTrace();
			}
    	}
    	String messages = chatRoom.getMessagesByDateAsString(lastDate);
    	List<User> activeUsers = chatRoom.getActiveUsers();
    	Map<String,Object> json = new HashMap<String,Object>();
    	json.put("messages", messages);
    	json.put("users", activeUsers);
    	renderJSON(json);
    }