Re: Open Web Browser and pass URL with Query string
sanjeev.atvankar@gmail.com wrote:
...
I develop console application that Open Web Browser and pass URL with
query string.
My code is as below:
...
This few lines of code is a very fragile way to try and find the
default browser - there are probably better alternatives.
JWS BasicService.showDocument(URL)
Applet AppletContext.showDocument(URL)
pre 1.6 Desktop application BrowserLauncher2
1.6+ Desktop.browse(URI)
As an aside - I put the couple of lines of the URL
and params together through the JWS showDocument
method* and it retained the params. Of course it was
a 404 here - but that is not the point.
Note that web start is not suited to pure console
applications, so I expect you will be better looking
to Desktop.getDesktop().browse().
OTOH, opening a browser from within a console app.
seems a little suspicious in the first place..
Is this code expected to work in a 'headless' environment?
(Something like a server that supports *no* GUIs at all).
* <http://www.physci.org/jws/#bs>
<http://www.physci.org/jws/basicserv.jnlp>
--
Andrew Thompson
http://www.athompson.info/andrew/
Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-general/200710/1