Name: dbT83986 Date: 02/09/99
I subscribe to several Java development mailing lists for various platforms.
One question that comes up alot is how to best use Runtime.exec() to pass a URL
to the Netscape browser. Now, on UNIX and Windows platforms, one can pass in a
String containing the URL as one of the parameters, or just pass in the URL as
part of a command-line flag( i.e.: 'Runtime.exec("netscape -remote http://my.url.com")');
however, on Macintosh, command-line flags are not
supported. Apple's Java porting team has worked around this issue by having
their implementation of the runtime parse the parameters, and if the parameter
looks like a URL, they send a "gurl" AppleEvent to the browser, which tells it
to load the URL.
Since this seems to be the most common use of Runtime.exec(), it would be a
nice feature to have an exec method which accepts a URL object (this would make
life easier for the Apple folks, at least - they could just have their
implementation send the "gurl" event when Runtime.exec() is called with a URL object as a
parameter). In this way, developers could simply pass in a URL object (which
may have been constructed for some other reason in their application) to invoke
the browser with.
This way, the platform-dependent implementation could just
get the URL string from the URL object and pass it appropriately
to the browser.
(Review ID: 43562)
======================================================================
I subscribe to several Java development mailing lists for various platforms.
One question that comes up alot is how to best use Runtime.exec() to pass a URL
to the Netscape browser. Now, on UNIX and Windows platforms, one can pass in a
String containing the URL as one of the parameters, or just pass in the URL as
part of a command-line flag( i.e.: 'Runtime.exec("netscape -remote http://my.url.com")');
however, on Macintosh, command-line flags are not
supported. Apple's Java porting team has worked around this issue by having
their implementation of the runtime parse the parameters, and if the parameter
looks like a URL, they send a "gurl" AppleEvent to the browser, which tells it
to load the URL.
Since this seems to be the most common use of Runtime.exec(), it would be a
nice feature to have an exec method which accepts a URL object (this would make
life easier for the Apple folks, at least - they could just have their
implementation send the "gurl" event when Runtime.exec() is called with a URL object as a
parameter). In this way, developers could simply pass in a URL object (which
may have been constructed for some other reason in their application) to invoke
the browser with.
This way, the platform-dependent implementation could just
get the URL string from the URL object and pass it appropriately
to the browser.
(Review ID: 43562)
======================================================================
- duplicates
-
JDK-6255196 API to launch desktop helper applications
- Closed
- relates to
-
JDK-4906974 Universal Browser Launch
- Closed