From: <fza...@us...> - 2005-12-17 05:12:55
|
Update of /cvsroot/struts/ajaxchat In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21536 Modified Files: lobby.jsp room.jsp Log Message: Index: lobby.jsp =================================================================== RCS file: /cvsroot/struts/ajaxchat/lobby.jsp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** lobby.jsp 30 Nov 2005 22:31:58 -0000 1.3 --- lobby.jsp 17 Dec 2005 05:12:46 -0000 1.4 *************** *** 14,17 **** --- 14,25 ---- /** + * This variable holds a value that is incremented with each request made. + * The value is appended to the requested URL so that the URL is always + * unique. This is done to get around some caching issues with IE. + */ + assureUnique = 1; + + + /** * This is the XMLHttpRequest object that is used to service this page * to update the stats (how many users are chatting in each room. *************** *** 77,82 **** // any events the instance fires. xhrLobbyUpdateStats.onreadystatechange = lobbyUpdateStatsHandler; ! // Set the target URI for the request. ! target = "<html:rewrite action="ajaxLobbyUpdateStats" />"; // One minor problem that if (sendAJAXRequest) { --- 85,93 ---- // any events the instance fires. xhrLobbyUpdateStats.onreadystatechange = lobbyUpdateStatsHandler; ! // Set the target URI for the request. Note that we append a ! // value that will ensure that the URL is always unique. ! // This is to deal with caching issues in IE. ! target = "<html:rewrite action="ajaxLobbyUpdateStats" />" + ! "?assureUnique=" + assureUnique++; // One minor problem that if (sendAJAXRequest) { Index: room.jsp =================================================================== RCS file: /cvsroot/struts/ajaxchat/room.jsp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** room.jsp 30 Nov 2005 22:31:58 -0000 1.3 --- room.jsp 17 Dec 2005 05:12:46 -0000 1.4 *************** *** 14,17 **** --- 14,28 ---- /** + * These variables hold a value that is incremented with each request made. + * The value is appended to the requested URL so that the URL is always + * unique. This is done to get around some caching issues with IE. + * Note that the AJAX request to post of message DOES NOT need this + * because it is a POST, which is always unique. + */ + assureUniqueUsersInRoom = 1; + assureUniqueGetMessages = 1; + + + /** * This is the size of the font in the chat scroll. It is adjustable * between 8 and 48 using the magnification icons. Note that affects both *************** *** 100,105 **** // any events the instance fires. xhrListUsersInRoom.onreadystatechange = listUsersInRoomHandler; ! // Set the target URI for the request. ! target = "<html:rewrite action="ajaxListUsersInRoom" />"; // Go ahead and fire off the request, no payload to send. xhrListUsersInRoom.open("get", target, true); --- 111,119 ---- // any events the instance fires. xhrListUsersInRoom.onreadystatechange = listUsersInRoomHandler; ! // Set the target URI for the request. Note that we append a ! // value that will ensure that the URL is always unique. ! // This is to deal with caching issues in IE. ! target = "<html:rewrite action="ajaxListUsersInRoom" />" + ! "?assureUnique=" + assureUniqueUsersInRoom++; // Go ahead and fire off the request, no payload to send. xhrListUsersInRoom.open("get", target, true); *************** *** 169,174 **** // any events the instance fires. xhrGetMessages.onreadystatechange = getMessagesHandler; ! // Set the target URI for the request. ! target = "<html:rewrite action="ajaxGetMessages" />"; // Go ahead and fire off the request, no payload to send. xhrGetMessages.open("get", target, true); --- 183,191 ---- // any events the instance fires. xhrGetMessages.onreadystatechange = getMessagesHandler; ! // Set the target URI for the request. Note that we append a ! // value that will ensure that the URL is always unique. ! // This is to deal with caching issues in IE. ! target = "<html:rewrite action="ajaxGetMessages" />" + ! "?assureUnique=" + assureUniqueGetMessages++; // Go ahead and fire off the request, no payload to send. xhrGetMessages.open("get", target, true); |