I've searched everywhere for this issue, all I found is same problem but with other programming language, so that didn't help me a lot :(
Now I'm using Hibernate, Struts to develop my web site, when an user connect I should display unread messages. I've developed my own solution, but seems to me very costly here it is:
<script type="text/javascript">
var auto_refresh = setInterval(
function ()
{
var url = "<%=request.getContextPath()%>"+"/MessagesRecus.do";
jQuery("#messages").load(url).fadeIn("slow");
}, 400); //Raffraichir chaque 1 seconde
</script>
MessagesRecus.do : is an action that gets unread messages from the DB
I've learned, while I was looking on the other sites, about push notification system. Does anyone have an idea about it? any other suggestion is welcome :) Thank u in advance.