Friday, January 14, 2011

IIS and Glassfish together

This is really just a note to myself. However if you want to run IIS and glassfish on the same windows 2008 server it's not enough to config IIS to listen on one IP address. You need to tell windows that it is responsible for only one of the addresses. You can do this form the command line:


netsh http add iplisten ipaddress=xxx.xxx.xxx.xxx

Second Glassfish will need to be configured to listen to only one address. In the config.xml for the domain find the network -listeners and add an address to port 80:


Thursday, January 13, 2011

Firefox and undefined array elements

So here's a Javascript question. Now I admit I'm not a Javascript expert so this ones got me a bit stumped.


In the following code snippet I'm trying to get a function to do something only when it is
first called. It can be called with a number of items (identified by an integer I), it
should call itself only the first time it is called with that arguement. I have an array (lsaCall)
with only the first item defined (and set to 0). If the array element is undefined (or 0) then the function
calls itsel on a timer.

var lsaCall = [0];
function loadSubscribedArticles(i,tag,Author){
 
 //alert("lsaCall "+lsaCall[i]);
 if ((lsaCall[i]==undefined) || (lsaCall[i] ==0)) {
  lsaCall[i]=1;
  //alert("Undefined"+lsaCall[i]);
  var int=self.setInterval("loadSubscribedArticles('"+i+"','"+tag+"','"+Author+"')",1000);
  
 }
}

This works fine and dandy but doesn't work at all in firefox. It complains that lsaCall
is undefined (well I know that !)
Any ideas on how to get this working in firefox ? Is there a better way of doing it ?