Launching Browser and POSTing at the same time

Discussion in 'Java' started by Bob, Sep 21, 2005.

  1. Bob

    Bob Guest

    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
     
    Bob, Sep 21, 2005
    #1
    1. Advertising

  2. Bob

    Anton Spaans Guest

    "Bob" <> wrote in message
    news:...
    > 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.
     
    Anton Spaans, Sep 21, 2005
    #2
    1. Advertising

  3. Bob

    Bob Guest

    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
     
    Bob, Sep 21, 2005
    #3
  4. Bob

    Oliver Wong Guest

    "Bob" <> wrote in message
    news:...
    > 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
     
    Oliver Wong, Sep 21, 2005
    #4
  5. 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

    Bob wrote:

    > 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
    >
     
    =?ISO-8859-1?Q?Karl_=D8ie?=, Sep 21, 2005
    #5
  6. Bob

    Roedy Green Guest

    On 21 Sep 2005 06:57:45 -0700, "Bob" <> wrote or
    quoted :

    >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.

    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Again taking new Java programming contracts.
     
    Roedy Green, Sep 21, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer
    Replies:
    0
    Views:
    436
    Kevin Spencer
    Sep 13, 2004
  2. hellrazor

    launching executable from web browser?

    hellrazor, Aug 25, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    649
  3. =?Utf-8?B?SmFpbWUgU3R1YXJkbw==?=

    Configuration error launching a ASPX in web browser

    =?Utf-8?B?SmFpbWUgU3R1YXJkbw==?=, Oct 18, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    25,481
    Ted Harper
    Oct 19, 2005
  4. AmitKu
    Replies:
    7
    Views:
    522
    John Timney \(MVP\)
    Jan 8, 2007
  5. franckspike
    Replies:
    1
    Views:
    329
    Boris
    Jul 3, 2008
Loading...

Share This Page