Launching Browser and POSTing at the same time

B

Bob

Hi,

I want to do is the following from a java program:
-Launch internet explorer (or any browser if possible) at:
http://myURL

-Pass POST parameters at myURL.
i.e. If this was being done with GET I would be doing
http://myURL?param1=value1&param2=value2, however this needs to be done
using POST because value1 and value2 could be very big.

The reason I want to post these values it to make some form fields
pre-populated when the page is launched.

is there a way to do this?

Thank you all in advance,

B
 
A

Anton Spaans

Bob said:
Hi,

I want to do is the following from a java program:
-Launch internet explorer (or any browser if possible) at:
http://myURL

-Pass POST parameters at myURL.
i.e. If this was being done with GET I would be doing
http://myURL?param1=value1&param2=value2, however this needs to be done
using POST because value1 and value2 could be very big.

The reason I want to post these values it to make some form fields
pre-populated when the page is launched.

is there a way to do this?

Thank you all in advance,

B

This is not a JavaScript newsgroup, but here it goes anyways:
Change the form's target to a value other than empty ("") or self ("self").

E.g.
Code:
....
var newTarget = "newbrowserwindow";
var oldTarget = form.target;
....
childWin = window.open("", newTarget, strFeatures);
....
form.target = newTarget;
form.submit();
hewform.target = oldTarget; // be sure not *all* submits are sent to the new
window;
....
-- Anton.
 
B

Bob

I think you misread what I want to do. I don't want to do this with
javascript. I only want to launch the browser from a java application
at a page with POST parameters.

In other words I want to ask the browser to make an HTTP request that
includes POST parameters
 
O

Oliver Wong

Bob said:
Hi,

I want to do is the following from a java program:
-Launch internet explorer (or any browser if possible) at:
http://myURL

-Pass POST parameters at myURL.
i.e. If this was being done with GET I would be doing
http://myURL?param1=value1&param2=value2, however this needs to be done
using POST because value1 and value2 could be very big.

The reason I want to post these values it to make some form fields
pre-populated when the page is launched.

is there a way to do this?

I think what you want to do depends on what API the browser provides.
(E.g. are there command line parameters to force IE to do a post?) There
isn't a way in the HTTP standard to do this merely by providing an URL, if
that's what you're thinking.

- Oliver
 
?

=?ISO-8859-1?Q?Karl_=D8ie?=

Perhaps you could a html write a file to disk that contained a form and
a onload(form.submit()). Then use runtime.exec to launch explorer or
mozilla at that file?

Karl Øie
 
R

Roedy Green

The reason I want to post these values it to make some form fields
pre-populated when the page is launched.

Some possibilities:

1. create the page locally, and point the browser at the page on
launch. Then all the user need do is check the form over and hit
SUBMIT.

2. send the post yourself. Get the result.Cache the result. Fireup the
browser pointing to that result page. You could even do the two in
parallel.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top