f.add(new Button("send").add(new AjaxFormSubmitBehavior("onclick"){
private static final long serialVersionUID = -3746739738826501331L;
protected void onSubmit(AjaxRequestTarget target) {
ChatDao dao = Application.getBean(ChatDao.class);
ChatMessage m = new ChatMessage();
m.setMessage(message);
m.setSent(new Date());
m.setFromUser(Application.getBean(UsersDao.class).get(WebSession.getUserId()));
dao.update(m);
IWebSocketConnectionRegistry reg = IWebSocketSettings.Holder.get(getApplication()).getConnectionRegistry();
for (IWebSocketConnection c : reg.getConnections(getApplication())) {
try {
c.sendMessage(getMessage(m).toString());