Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Opening default browser with dynamic URL

Reply
Thread Tools

Opening default browser with dynamic URL

 
 
Josh
Guest
Posts: n/a
 
      07-19-2003
In my Java app, I would like to open some help files in the user's
default browser when they click a Help button. I found lots of
examples using this type of call:

Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler
file://wherever/help.html");

(Substitute the real file path for "wherever")

But my problem is that I'm using a dynamic help system where the URL
that I am supposed to put into a browser to reach a given help file is
of this form:

file://wherever/index.htm?chapter=test&topic=help1

If I use that URL string in the call to Runtime.exec(), I get an error
message titled "Problem with Shortcut", saying "Unable to open file
""file://wherever/index.htm?chapter=test&topic=help1"".

It opens correctly if I remove the tag stuff at the end and just open:

file://wherever/index.htm

Any ideas on how I can do this?
 
Reply With Quote
 
 
 
 
Josh
Guest
Posts: n/a
 
      07-21-2003
Nobody's come across this problem before?

Well, is there any way to retrieve the path to the user's default
browser? Then I could directly run the browser with the dynamic
help, which seems to work (Runtime.exec("C:\Program Files\Internet
Explorer\iexplore.exe",
"file://wherever/index.htm?chapter=test&topic=help1"); opens
correctly).

http://www.velocityreviews.com/forums/(E-Mail Removed) (Josh) wrote in message news:<(E-Mail Removed). com>...
> In my Java app, I would like to open some help files in the user's
> default browser when they click a Help button. I found lots of
> examples using this type of call:
>
> Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler
> file://wherever/help.html");
>
> (Substitute the real file path for "wherever")
>
> But my problem is that I'm using a dynamic help system where the URL
> that I am supposed to put into a browser to reach a given help file is
> of this form:
>
> file://wherever/index.htm?chapter=test&topic=help1
>
> If I use that URL string in the call to Runtime.exec(), I get an error
> message titled "Problem with Shortcut", saying "Unable to open file
> ""file://wherever/index.htm?chapter=test&topic=help1"".
>
> It opens correctly if I remove the tag stuff at the end and just open:
>
> file://wherever/index.htm
>
> Any ideas on how I can do this?

 
Reply With Quote
 
 
 
 
Andy Flowers
Guest
Posts: n/a
 
      07-21-2003
Try looking at
http://www.javaworld.com/javaworld/j...javatip66.html. It may help.

"Josh" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> In my Java app, I would like to open some help files in the user's
> default browser when they click a Help button. I found lots of
> examples using this type of call:
>
> Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler
> file://wherever/help.html");
>
> (Substitute the real file path for "wherever")
>
> But my problem is that I'm using a dynamic help system where the URL
> that I am supposed to put into a browser to reach a given help file is
> of this form:
>
> file://wherever/index.htm?chapter=test&topic=help1
>
> If I use that URL string in the call to Runtime.exec(), I get an error
> message titled "Problem with Shortcut", saying "Unable to open file
> ""file://wherever/index.htm?chapter=test&topic=help1"".
>
> It opens correctly if I remove the tag stuff at the end and just open:
>
> file://wherever/index.htm
>
> Any ideas on how I can do this?



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
open url WITH PARAMETERS in default browser epicwinter@hotmail.com Java 6 10-13-2005 02:40 AM
how to startup the default web browser to open a url? flyaflya Python 2 06-13-2005 03:38 AM
opening default browser R Java 3 05-30-2005 09:43 AM
Java opening the 'system default' web browser? MS Java 7 03-05-2005 01:50 AM
programmatically visiting a URL without opening browser session Ken Fine ASP General 2 10-25-2004 11:40 PM



Advertisments