Hi Gregory,
#1 is ok for applications but is incompatible with
Applets. This is the main reason Batik uses #2. Also
there are some things that are fairly annoying about
the java.net.URL class (it won't try and make sense of
'partial' URL's, always throwing errors etc).
Gregory wrote:
I need to implement a custom protocol handler. I have
tried two approaches:
1- The Java way:
- extend java.net.URLStreamHandler
- extend java.net.URLConnection
- start java with the arg
-Djava.protocol.handler.pkgs=my.handler.package
or
2- The batik way:
- create a custom ParsedURLData;
- create a custom ParsedURLProtocolHandler.
- ParsedURL.registerHandler(new
CustomParsedURLProtocolHandler());
Both seem to work fine with batik.
I would prefer to use solution 1 because the custom
protocol is used in other parts of my application.
But is there a reason to prefer solution 2? Maybe in
term or performance or to avoid some potential
problems/exceptions?
Thanks
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]