DemonstrationExample of Using showDocument()
This example demonstrates the use of the showDocument() method in the JavaCGIBridgeExtension class. showDocument() is normally an AppletContext method in the Java JDK. showDocument() in JavaCGIBridgeExtension provides some additional functions.
First, if you are using Mac Netscape 3.x, this showDocument() fixes a bug with the showDocument method in this browser. The Mac Bug manifests itself by opening a blank window when a target is opened. The workaround is to call the target showDocument twice or, if _blank is the target, then the class internally generates a random target name to be used to "simulate" opening with a true _blank target.
The second advantage is that it allows you to pass form data to a CGI script using the GET method for the CGI script. This applet demonstrates this by passing a message that you type into the TextField to a CGI script when it opens the new browser window. showDocument() automatically URLEncodes the form variable information for inclusion on the URL line.
Applet Demonstrating showDocument()
View The Source To Example11Applet.java
View The Source To JavaCGI Bridge.java
View The JavaCGIBridge JavaDoc File
View The Source To JavaCGIBridgeExtension.java
View The JavaCGIBridgeExtension JavaDoc File
View The Source To message.cgi
Plain CGI script which prints out an HTML document with a
{message} form variable.
Run message.cgi CGI/Perl Script with default message
Run message.cgi CGI/Perl Script with "Hello, world!" message