[jboss-cvs] jboss-seam/src/remoting/org/jboss/seam/remoting ...

Shane Bryzak sbryzak at redhat.com
Sun Jun 17 17:53:56 EDT 2007


  User: sbryzak2
  Date: 07/06/17 17:53:56

  Modified:    src/remoting/org/jboss/seam/remoting  remote.js
  Log:
  JBSEAM-1249
  
  Revision  Changes    Path
  1.6       +16 -5     jboss-seam/src/remoting/org/jboss/seam/remoting/remote.js
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: remote.js
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/remoting/org/jboss/seam/remoting/remote.js,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- remote.js	16 Jun 2007 05:10:42 -0000	1.5
  +++ remote.js	17 Jun 2007 21:53:56 -0000	1.6
  @@ -82,10 +82,23 @@
     return null;
   }
   
  +Seam.Remoting.extractEncodedSessionId = function(url) 
  +{
  +	var sessionId = null;
  +  if (url.indexOf(';jsessionid=') >= 0)
  +  {
  +    var qpos = url.indexOf('?');
  +    sessionId = url.substring(url.indexOf(';jsessionid=') + 12, qpos >= 0 ? qpos : url.length); 
  +  }
  +	return sessionId;
  +}
  +
   Seam.Remoting.PATH_EXECUTE = "/execute";
   Seam.Remoting.PATH_SUBSCRIPTION = "/subscription";
   Seam.Remoting.PATH_POLL = "/poll";
   
  +Seam.Remoting.encodedSessionId = Seam.Remoting.extractEncodedSessionId(window.location.href);
  +
   // Type declarations will live in this namespace
   Seam.Remoting.type = new Object();
   
  @@ -590,11 +603,9 @@
   
     asyncReq.onreadystatechange = function() {Seam.Remoting.requestCallback(asyncReq, callback); }
   
  -  var href = window.location.href;
  -  if (href.indexOf(';jsessionid=') >= 0)
  +  if (Seam.Remoting.encodedSessionId)
     {
  -    var qpos = url.indexOf('?');
  -    path += href.substring(href.indexOf(';jsessionid='), qpos >= 0 ? qpos : url.length()); 
  +    path += ';jsessionid=' + Seam.Remoting.encodedSessionId;
     }
     
     asyncReq.open("POST", Seam.Remoting.resourcePath + path, true);
  
  
  



More information about the jboss-cvs-commits mailing list