Hi everybody,

I have the following problem:
My Web application needs to handle Lotus Notes URLs which use the scheme
"notes". However, since Java does not know this protocol by default, it throws a
MalformedUrlException when I construct a java.net.URL from a notes:// 
URL-string.

So, I read up on custom URL handlers and as far as I understand, you have to
code a custom URLStreamHandler class and a custom URLConnection class. Okay, no
big deal. However, there are three ways to register your new handler:

1) put it in the sun.net.www.protocol.yourprotocol package
2) put it in a custom package and declare that package to the JRE using the
java.protocol.handler.pkgs system property
3) register a custom URLStreamHandlerFactory using 
URL.setUrlStreamHandlerFactory

problem is, none of these approaches work in Tomcat 5.5. For 1), this simply
didn't have any effect for me. 2) neither, maybe Tomcat simply ignores that
property? 3) doesn't work because Tomcat already registers its own factory, and
for some reason I can't quite put my hands on you are not allowed to call that
method twice per JVM instance.

This issue is also discussed on Sun's Java issue tracker:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4648098

The ticket has been opened six years ago and still no fix!

Does Tomcat meanwhile have some workaround for this? I mean, I don't even need
an actual URL connection, I just want to pass custom URL strings, which should
be perfectly fine if they are valid URLs, no?!

I hope you can help!

Best,
Matt


---------------------------------------------------------------------
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