This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Hi, I have one chat application for which i am using one simple action class say LoginAction. Now i have index.jsp as the login page. Suppose i want to add the user into chat list when he comes from index.jsp with authentication. Using servletcontext i am managing the list in LoginAction class. Problem is everytime i refresh a page say with refresh button or pressing f5 same user gets added in to the list. How can i make a difference between new request and page refresh to avoid so. If you want i can provide the code also..
I am not sure about your "new request versus refresh" question...but the first thing that came to my mind would be to store the list using something like a HashMap, using whatever unique value you have (username?). Then before adding an entry to the list, call the containsKey method and only add new entries.