Navigation Bar Staff Secure Home Products Partners Services Portfolio News Corporate Jobs Home
border image border image
transparent spacer image border image
transparent spacer image transparent spacer image transparent spacer image
Navigate Database Table: "WOFAQ"
Current record is #2 out of 21 in found set (21 total records in table)
List View    Search    Find All
<<First <Prev Next> Last>>

Question What's up with domain names in WebObjects URLs? 
Answer One of our guys got tripped up because his hostname was floating between what we expected it to be and his IP address. After some digging, I've resolved a mystery (well, it was a mystery to me .. maybe other people knew about it :) ). If your CGI adaptor URL is http://127.0.0.1/cgi-bin/WebObjects, at runtime, WOApplication converts that to http:///cgi-bin/WebObjects. If you CGI adaptor URL is http://localhost/cgi-bin/WebObjects, at runtime, WOApplication converts that to http:///cgi-bin/WebObjects. application.host() considers your -WOHost setting, hostAddress uses InetAddress.getByName(host()). So if you've ever been confused and perplexed as to why your app keeps using your IP address even when you set WOHost, this is why. This is especially a problem when you're testing with cookies on your local machine, which is really sensitive to host name changing. Part of the confusing part here is that WOLips defaults to 127.0.0.1. I think this is wrong and I'm about to change it (unless someone has a good reason behind it). In the meantime, you can to several things: 1) Change the WOAdaptorURL in your launch config (to change this on a per-app basis) 2) Change the WOAdaptorURL in Preferences=>WOLips=>Launch. This will change the defaults globally. I don't recall if this cascades to existing run configs or not. So to be safe and make sure your app works in dev like it does in deployment (which would have a consistent hostname), set WOAdaptorURL to http://localhost/cgi-bin/WebObjects and add a -WOHost yourhost.local (or whatever your fixed hostname is). Another symptom of this is an Ajax update on a page that generates complete URLs. The complete URLs will generate with your hostname always because it generates with different logic than this startup process. So you'll get a cross domain failure where the Ajax request will fail _with no client-side error at all on Safari or FireFox_ ... It just won't do ANYTHING. It's a terrible problem to track down. Log this one away in the back of your mind, because you'll need it again. -- Mike Schrag 
Figure 1 No file available. 
Figure 2 No file available. 
Figure 3 No file available. 
Date Modified Jul 15 2008 
Modified By chill@global-village.net