aspose file tools*
The moose likes Applets and the fly likes Opening a new browser window from the applet and supplying data via POST Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Opening a new browser window from the applet and supplying data via POST" Watch "Opening a new browser window from the applet and supplying data via POST" New topic
Author

Opening a new browser window from the applet and supplying data via POST

Gregory Grondin
Greenhorn

Joined: Jun 11, 2012
Posts: 5
I've got a request in to add a button to one of our applets that will launch a web page in a new browser window.

We've done this before using getApplet().getAppletContext().showDocument(url, "_blank"); with any data we want to supply added to the URL's query string (usually encrypted and URLEncoded).

This time around though I'm being told that they want the data submitted via POST. My understanding is that this is not directly or easily doable without some intermediate steps.

Any thoughts or suggestions?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39549
    
  27
It would be tricky, to say the least. One approach might be for the applet to call a JavaScript method on the same web page that the applet is on, passing along any data it needs. The JavaScript could then create an HTML form on the page that contains all the data, and submit that via a POST to a new window (using target="_blank" in the form). The form could be in an invisible IFrame, so that the user doesn't see it.

I'm not sure if this would work, but I don't see a fundamental problem why it wouldn't.


Ping & DNS - updated with new look and Ping home screen widget
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Opening a new browser window from the applet and supplying data via POST
 
Similar Threads
request by applet response to browser ?
Child Window
any scanning tools
ProJavaFX examples
Help!Applet calling JAX-RPC Webservice over HTTPS