Re: bug with WOContext.completeURLWithRequestHandlerKey
Re: bug with WOContext.completeURLWithRequestHandlerKey
- Subject: Re: bug with WOContext.completeURLWithRequestHandlerKey
- From: Chuck Hill <email@hidden>
- Date: Thu, 11 Sep 2003 14:58:09 -0700
I've seen it do weird things, but not exactly this. Are you using this
within the confines of teh RR loop?
I did battle with it when using the secure binding on WOHyperlink. There
is definately a bug in where it takes the domain from. Make sure you use
-DWOAdaptorURL to set it on the command line. That fixed it for me.
As for the port number, it should be the webserver's port (80, 443 etc.)
not the apps port. I *have* see it make useless URLs like
http://www.domain.com:443/...
Yeah, like that is going to work! Easy enough to fix though. Create a
WOContext sub-class and implement this method:
public String completeURLWithRequestHandlerKey(String requestHandlerKey,
String requestHandlerPath,
String queryString,
boolean isSecure,
int somePort) {
return super.completeURLWithRequestHandlerKey(requestHandlerKey,
requestHandlerPath, queryString, isSecure, isSecure ? 443
: 80);
}
Register it in your Application subclass with
public String contextClassName() {
return "FixedContext";
}
That beat it into submission for me.
For whatever little it may be worth,
Chuck
At 01:19 PM 11/09/2003 -0500, Jonathan Rochkind wrote:
>The WOContext.completeURLWithRequestHandlerKey method is sometimes
>returning an improper URL for me.
>
>I call it during appendToResponse on a page returned by the initial app
>entry point, and it returns a more or less proper URL of the form:
>http://[numericalIPAddress]/cgi-bin/WebObjects/[AppName].woa/[Instance
>#]/[request handler key]
>
>Don't know why it's using the numerical IP address there.
>
>But when I call it on subsequent pages, it returns a completley invalid IP
>of the form:
>
>http://[unqualified hostname]:[port
>#]/cgi-bin/WebObjects/[AppName].woa/[Instance #]/[request handler key]
>
>The unqualified hostname doesn't work, of course, and the port # is
>improper, since this is an app with direct connect turned off, deployed
>through the web server.
>
>Has anyone else encountered this? It's easy enough to work around, I just
>write my own version of completeURLWithRequestHandlerKey, no problem. But
>I don't want to spend the time to experimentally understand exactly what
>conditions cause this bug, and I'm afraid that's what Apple will ask for if
>I report it. Sigh.
>
>--Jonathan
>_______________________________________________
>webobjects-dev mailing list | email@hidden
>Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>Do not post admin requests to the list. They will be ignored.
>
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.