Re: Java Applet wants to talk to WebServer

From: Alireza Assadzadeh <aassadza_at_doe.carleton.ca>
Date: 1996/07/14
Message-ID: <31E9C147.5D6B_at_doe.carleton.ca>#1/1


Andy Trick wrote:
>
> In message <31DED33C.FAE_at_access.ch> - Stephan Gloor <stgloor_at_access.ch>Sat, 06
> Jul 1996 22:57:32 +0200 writes:
> >
> >Hi prob solver.
> >
> >I need to implement a Java Applet which requests a Web page from
> >WebServer on demand. Think of it as a nice button which sends a message
> >to the WebServer "Send the page xy.html" when being pressed.
> >
> >Do you know what if WebServer already supports such a feature ?
>
> Send the page to what? Isn't this a browser feature?
>
> Andy
> --------------------------------------------
> atrick_at_prominic.com http://www.prominic.com

Are you are refering to creating links inside applets? This would mean that you would tell the browser running some applet to load a new page.

Creat a new instance of the class URL. There are four different forms. Here is an example, keep in mind that because you have to catch a malformed URL exeception, the URL constructor shoud be surrounded with a try...catch:

import java.awt.*;
import java.net.URL;
import java.net.MalformedURLException;

String url = "http://www.oracle.com/";
try { new_URL = new URL(url); }
catch ( MalformedURLExeption e) {

   System.out.println("Something went wrong in trying " + new_URL); }
/* now you can pass it to the browser */ getAppletContext().showDocument(new_URL);

I hope this would help. Received on Sun Jul 14 1996 - 00:00:00 CEST

Original text of this message