open url WITH PARAMETERS in default browser

E

epicwinter

I am trying to automatically open a url from the default browser from a
java application. I can open a url in the browser no problem. I have
looked at the commonly sited articles here:
http://dmoz.org/Bookmarks/D/deadsea/Java_Help/Web_Browser/

For windows xp I use this command:
commandArgs = new String[3];
commandArgs[0] = "cmd.exe";
commandArgs[1] = "/C";
commandArgs[2] = absoluteFileName;
Runtime.getRuntime().exec(commandArgs);

If I am trying to open c:\myhtmlfile.html it works great.
But when I try to open it c:\myhtmlfile.html?parameter1=ABCD
It does not work. I have tried every possible way to do this and the
closest I get it to working is it just opens the page without the
parameter. I can not figure out how to open it with a parameter.

Please advise, thanks
-ryan
 
E

epicwinter

You aren't reading my question. This all works fine for normal urls
but not one with parameters!
 
S

Stefan Schulz

You aren't reading my question. This all works fine for normal urls
but not one with parameters!

Well, look at it this way: Who would interpret the parameter anyway? If it
is a file on the local file system, there is no webserver to use these
parameters in any way. ;)
 
E

epicwinter

The html file contains a reference to a flash file which accepts the
paramters through javascript.
 
A

Andrew Thompson

You aren't reading my question. This all works fine for normal urls
but not one with parameters!

?

Your subject states..
open url WITH PARAMETERS in default browser

Your first attempt noted..
For windows xp I use this command:

Now, pause for a moment, and let this sink in,
- BrowserLauncher works cross-platform
- You can load URL's with parameters using BrowserLauncher

Here is the proof. I have a little program called
JVMClean. It is made to remove the MSVM from IE,
but it uses BrowserLauncher to connect back to
my site with 'bug reports'.

Just to check that everything still works after a recent
site move, I just downlaoded and launched JVMClean again.
You can find it here.
<http://www.physci.org/jvmclean.jsp?pt=download>

When you first load it, it shows a Dialog with
'further help/notes', it mentions
F12 - Report a bug ( ..tough if you're not on Windows ;)

Dismiss the dialog and press the F12 key to see
BrowserLauncher go to my site using an URL with
parameters. Which brings me back to..

The solution I quoted is not only known to work for
parameters, but X-plat. What more do you want?

As far as why your code is failing, I am not sure.

If you are really *determined* to get this working by
calling Runtime.exec() (e.g. as an exercise in
understanding Runtime.exec()) I suggest you post a
short, complete example[1] of what you are doing.
*Short* compilable code that displays the problem
is more likely to get the close attetnion of some
people in the group.
[1] <http://www.physci.org/codes/sscce.jsp>

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top