CST(71)-Web Client/Server, Java-style

Java introduces an entirely new model of client/server interaction for the web. It lets us write small component-like programs called ‘applets’ that can be downloaded into a browser that is Java-compatible. Applet allow us to distribute executable content across the Web along with data. Here are the steps:

1. Request the applet A Web browser requests a Java applet when it encounters the new HTML <APPLET> tag. The tag’s attributes include the name of the program- the class filename. The program typically resides on the same server from which the HTML, page originates.

2. Receive the applet. The browser initiates a separate TCP/IP session to download each applet it encounters within a Web page. The browser treat the Java applet like any other HTML object

3. Load and execute the applet. The browser loads the applet into the client’s memory, and then executes it. Typically the applet will create some kind of dynamic visual effect within the area of the page that is assigned to it. The <APPLET> tag attributes specify the size of the page that is assigned to it. The <APPLET> tag attributes specify the size of the region the applet will own. This is the piece of real estate within a page that belongs to the applet. The applet paints contents of its region, chooses the background color and fonts, and handles all the keyboard and mouse events. Note that the applet’s region doesn’t visually integrate with the rest of the page. It’s really a poor man’s compound document architecture.

4. Discard the applet. The browser deletes the applet from memory when it exists the web page.

Java Libraries:

The Java libraries extend the language; they provide a portable environment for writing thread-safe Java applications. The libraries consist of six Java packages that implement hundreds of classes. Here’s a brief description of what these packages offer.
  •  Java.lang provides classes that support basic Java objects and native types. You should always import this package into your code. This is where you’ll find implementations of the root class hierarchy, threads, exceptions, primitive data types, and a variety of other primitive classes.
  • provides classes that support reading and writing streams, files, and pipes. This is where you’ll find the Java equivalent of the familiar C standard I/O library.
  • provides classes that support network programming – including sockets, telnet interfaces, HTTP, and URL’s.
  •  Java.util provides a collection of utility classes that encapsulate data structures such as: dictionaries, hash tables, stacks, dates, strings, and others.
  •  Java.awt is an abstract windowing toolkit (awt). It provides a portable GUI layer for writing applications that you can move from one windowing system to another. The library contains classes for basic user interface elements- including events, frame containers, and widgets.
  •  Java. applet is a subclass of awt that supports animation and audio.
CST(71)-Web Client/Server, Java-style Reviewed by 1000sourcecodes on 21:50 Rating: 5
Powered by Blogger.