views:

70

answers:

1

I need to make an HTTP request to a resource that looks like "xy:index.html" in Java.

The HTTP implementation does not have to be sophisticated. I just need to be able to do this to avoid same-origin violations when running in development mode for a GWT app by forwarding HTTP requests on the server-side to the "xy" protocol.

Any clues about how I may be able to do this would be extremely appreciated. I feel like I'm a bit out of my league on this one ;)

A: 

I'm not sure if I understand the question properly but perhaps you can register a URL handler. This link has some info about how to do that. Perhaps you can register a custom handler for the xy: protocol and re-use the HTTP URL handlder for the real work.

Mr. Shiny and New
thanks for the reply. That's a very good link. I've read through it already but the example does not show how to use a Windows asynchronous pluggable protocol. I haven't been able to re-use java.net.HttpURLConnection or sun.net.www.protocol.http.HttpURLConnection because they throw errors like "host cannot be null". Even the basic Socket class requires a host and a port, neither of which are used in the pluggable protocol schema.
Craig