Hi,
I have a welcome.jsp page. I am also keeping track of users logged in. Once a user logs in, I update an attribute in ServletContext. Besides, his user deials, I also store a reference to his request and response objects in the ServletContext.
Whenever a new user logs in he is shown the welcome page. But I also want to notify all the other users that are logged in and show them a specific page telling them about the user who just logged in. I am trying to do it through ServletContextAttributeListener.
But when I fetch the request objects stored (for users already logged) from the ServletContext and try to send them a message about the new user, by saying (requestObject.getRequestDispatcher("/notifyOtherUsers")).include(requestObject, responseObject), I do not get any result.
There is no exception thrown either and the
Servlet does not execute beyond this line. If I comment out the line, the servlet executes further without problems.
Can I use the previously stored request objects this way to obtain a RequestDispatcher and then to include a page to those response objects?
Can the other logged in users be notified this way or they have to click on a "refresh" link somewhere to see who is the latest user that logged in!
Thanks in advance.