I am working on a web portal.I need to display a chat link on the page.The specifications are as follows :-
1. Chat link should be visible to specific user -- already defined in a table.
2. If chat link is visible then there are two cases in it.Firstly if timings are between 8 am to 6pm then the chat open image should be visible,else chat close image.
Is this only one page? If so, just use an if statement in the servlet of c:if in the JSP. If it is on multiple pages or you need to protect the chat pages themselves with the same logic, I would use a servlet filter - that way all the "is chat open" logic can be in the same place.
yes this is in one page only.But it may be possible that user is using the link and suddenly the clock stuck 6 so after 6 the link should not be visible.User needs to refresh the page to do so.One constraint is that I cannot use Ajax.How should i keep checking the time and refresh the page accordingly??