-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Matthias,

MK wrote:
| Christopher Schultz <chris <at> christopherschultz.net> writes:
|>
|> As I'm reading more in the API, I can see that the URL class has a
|> constructor that takes a URLStreamHandler. Could you utilize this
|> constructor instead?
|
| that's a good idea actually (although it would require me to parse the
incoming
| URL strings on my own; a job which is otherwise done by the URL ctor
itself, but
| oh well).

There is a URL constructor that accepts a URL and a "spec" (which is, in
fact, the URL you want to parse). I didn't try it myself, yet, but it
appears you could give the constructor an unrelated URL and it will
ignore it. Something like this:

static URL bogus = new URL("http://www.google.com/";);
static URLStreamHandler nullHandler = new URLStreamHandler() {

~    public URLConnection openConnection()
~    {
~        return null;
~    }
};

URL myURL = new URL(bogus, "notes://whatever", nullHandler);

| However, unfortunately this still does not help, because it merely
| moves the problem further down the implementation of that (somewhat
obscure) API
| I am using. The problem is that with this constructor, creating a URL
object on
| my side succeeds, but passing it to that API will still result in a
MalformedUrl
| somewhere down their implementation, maybe because they pack/unpack
the wrapped
| URL string to create other URL objects from it, dunno. Dang! I though
I almost
| had it :-)

Fantastic. Hmm... I think you might have to start messing around with
the Tomcat source... maybe look at how their URLStreamHandler works (the
one Filip mentioned registers the jndi:// protocol. Perhaps there's a
way to hook into that StreamHandler without too much trouble. Otherwise,
you may have to hack the class to register your protocol as well (at
least you don't have to /handle/ the protocol, too.

| I will try rolling a jar from my protocol handler and put it in the
places you
| suggested. Maybe that'll work, I'll report back.

That's your best bet so far, I think. I have one last trick up my sleeve
if that doesn't work.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkfEJCIACgkQ9CaO5/Lv0PCewACgkbZ2CAEcod9c9u0Q3YqeOY5h
gK4AmQGjgbkFGhSm6DCl2YsCbdvDMkEG
=B1jD
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to