private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
ChatDao dao = getBean(ChatDao.class);
ChatMessage m = new ChatMessage();
m.setMessage(unescapeXml(chatMessage.getDefaultModelObjectAsString()));
m.setSent(new Date());
m.setFromUser(getBean(UserDao.class).get(getUserId()));
dao.update(m);
IWebSocketConnectionRegistry reg = IWebSocketSettings.Holder.get(getApplication()).getConnectionRegistry();
for (IWebSocketConnection c : reg.getConnections(getApplication())) {
try {
c.sendMessage(getMessage(m).toString());