Author: sshyrkov Date: Thu Jun 21 19:09:37 2007 New Revision: 17700 URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D17700&repname= =3Djahia Log: JAHIA-2066: Sp2-SP3: exception when session ecpired in an engine - could we= make a small AJAX call to renew session when an engine is still open? =
http://www.jahia.net/jira/browse/JAHIA-2066 Resolved: Ajax keep alive call added into the engine window to send a keep = alive request to the server each (sessionTimeout/2) Added: trunk/core/src/webapp/jsp/keepAlive.jsp Modified: trunk/core/src/webapp/jsp/jahia/engines/engine.jsp Modified: trunk/core/src/webapp/jsp/jahia/engines/engine.jsp URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp= /jsp/jahia/engines/engine.jsp&rev=3D17700&repname=3Djahia =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- trunk/core/src/webapp/jsp/jahia/engines/engine.jsp (original) +++ trunk/core/src/webapp/jsp/jahia/engines/engine.jsp Thu Jun 21 19:09:37 = 2007 @@ -14,9 +14,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. = See the License for the specific language governing permissions and = limitations under the License. ---%> -<%@ page language=3D"java" contentType=3D"text/html;charset=3DUTF-8" %> -<?xml version=3D"1.0" encoding=3D"utf-8"?> +--%><%@ page language=3D"java" contentType=3D"text/html;charset=3DUTF-8" = +%><?xml version=3D"1.0" encoding=3D"utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> = @@ -174,6 +173,7 @@ <% } %> = <script type=3D"text/javascript" src=3D"<%=3DURL%>../javascript/serverdate= time.js"></script> +<script type=3D"text/javascript" src=3D"<%=3DURL%>../javascript/prototype/= prototype-150-compressed.js"></script> <% if (request.getAttribute("org.jahia.engines.html.headers") !=3D null) {= %> <%=3D (String) request.getAttribute("org.jahia.engines.html.headers") %> <% } %> @@ -301,6 +301,20 @@ setTimeout("checkParent()", checkParentTimeOut); } = = + var sendKeepAliveTimeOut =3D <%=3D session.getMaxInactiveInterval() * = 1000 / 2 %>; + function sendKeepAlive() { + new Ajax.Request('<%=3D request.getContextPath() + "/jsp/keepAlive= .jsp" %>', { + method: 'get', + onSuccess: function(transport) { + setTimeout("sendKeepAlive()", sendKeepAliveTimeOut); + }, + onFailure: function(transport) { + // TODO: display a message? + } + }); + } + setTimeout("sendKeepAlive()", sendKeepAliveTimeOut); + = function handleOnLoad() { setTimeout("checkParent()", checkParentTimeOut); } = Added: trunk/core/src/webapp/jsp/keepAlive.jsp URL: https://svndev.jahia.net/websvn/filedetails.php?path=3D/trunk/core/src= /webapp/jsp/keepAlive.jsp&rev=3D17700&repname=3Djahia =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- trunk/core/src/webapp/jsp/keepAlive.jsp (added) +++ trunk/core/src/webapp/jsp/keepAlive.jsp Thu Jun 21 19:09:37 2007 @@ -0,0 +1,12 @@ +<%@ page language=3D"java" contentType=3D"text/html; charset=3DISO-8859-1" = +%><% +response.setHeader("Cache-Control","no-cache, no-store, must-revalidate, p= rivate"); +response.setHeader("Pragma","no-cache"); +response.setDateHeader ("Expires", 295122600000L); +if (request.getSession(false) =3D=3D null || !request.isRequestedSessionId= Valid()) { + request.getSession(true); + response.sendError(HttpServletResponse.SC_FORBIDDEN); +} else { + request.getSession().getId(); + response.setStatus(HttpServletResponse.SC_OK); +}%> \ No newline at end of file _______________________________________________ cvs_list mailing list [email protected] http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list
