![]() ![]() ![]() ![]() |
Table of Contents |
The VolanoChat server provides servlets with the aliases shown below.
config
COM.volano.ConfigServlet
to allow Web based configuration of the VolanoChat applet properties.count
COM.volano.CountServlet
to return a page giving the current connection count of the VolanoChat server.proxy
COM.volano.ProxyServlet
to get a text, image, or sound file from a remote server on behalf of the client applet.register
COM.volano.RegisterServlet
to allow registration of event listeners interested in receiving server-side event notifications.The config servlet allows you to modify the VolanoChat applet properties through an HTML form on a Web page. The count servlet is provided as a way to show your visitors how many people are connected to your VolanoChat server. The proxy servlet is provided as a mechanism for allowing the VolanoChat applet and its embedded BannerPlayer applet to obtain text, image, and sound files from any machine on the Internet. The register servlet allows CGI scripts to be registered for callback server-side event notifications.
This servlet presents an HTML page for modifying the VolanoChat applet properties given a template and a properties file. The servlet parameters are:
template
applet.codebase
property value, such as the default template.html
file.properties
applet.codebase
property value, such as the default english.txt
file.See the section [7.1.3] Web-Based Configuration for information on how to set up the Web based applet configuration for your VolanoChat installation.
The count servlet simply fills in a Web page template with a count of the number of connections to your VolanoChat server. The template can be any Web page, such as:
<html> <head> <title>Connection Count</title> </head> <body> <p>Connection count = {0} </body> </html>
By default, this file is called count.html
in the VolanoChat server installation directory. Its name and location is defined in the servlets.txt
file by the count servlet's template
initialization argument. The number of connections is formatted into the {0} substitution variable in the same way that you define substitution variables when defining your VolanoChat server log formats.
For example, the following link brings up a page showing how many people are connected to Volano's demonstration chat server.
http://www.volano.com:8080/servlet/count
Since the count servlet returns an entire HTML document, you may want to place it into a separate, smaller frame of a frame set defining your Web page.
To understand the need for servlets such as the proxy servlet, you must first understand the security restrictions placed on Java applets when they run within Web browsers. Java applets are permitted to make network connections only to the machine from which they originated, as shown by the following figure.
Figure 1: Java applet networking security.
A network connection attempted to any other machine on the Internet is blocked by the browser with a security exception in the applet. The proxy servlet gets around the restriction by handling the connection with the applet while making sure the content comes from the actual target server.
The proxy servlet fetches the specified file on behalf of the requesting browser or applet, as shown by the four steps in the figure below.
Figure 2: Proxy servlet.
This servlet acts as a proxy server for fetching the specified image or anchor link. The parameters correspond to the attributes of a linked image, such as:
<a href="link.html"><img src="images/image.gif"></a>
The servlet parameters are:
src
Applet.getImage
method.href
AppletContext.showDocument
method.trace
true
if the proxy servlet should trace the headers of each HTTP request and response; otherwise false
. The default is false
.If both src
and href
are specified, the href
parameter is ignored.
The only difference between the src
format and the href
format is that the proxy servlet will automatically follow redirected HTTP responses when using the src
parameter, while the href
parameter will cause redirected HTTP responses to be returned to the actual client unmodified.
You can place the location of your proxy servlet in front of any VolanoChat applet resource not found on the machine running the VolanoChat server. For example, you can fetch banner advertisement images from remote machines by prefixing the image source locations with the proxy servlet address in the BannerPlayer applet parameters.
See the [7.4] BannerPlayer Applet chapter for a complete description of the BannerPlayer applet that is provided with your VolanoChat product. See the chapter [8.3.2] Using Remote Ad Servers for specific examples of how to display banners from ad servers and ad networks in your VolanoChat room windows.
This servlet allows CGI scripts or Java servlets to register for server-side event notifications for all events in a particular room. The servlet parameters are:
room
href
For example, assume VolanoChat's servlet runner is at chat.volano.com:8080
, a servlet called transcribe
could be registered for event notifications from the room Sample Chat Room with the following invocation (all on one line):
http://chat.volano.com:8080/servlet/register?room=Sample%20Chat%20Room& href=http://chat.volano.com:9080/servlet/transcribe
After the registration above, the transcribe servlet would receive all events from the room called Sample Chat Room in XML notation using an HTTP POST request. Please see the section [5.9] Listening for Events for details about the format of the event information.
![]() ![]() ![]() ![]() |
XHTML 1.0 | Table of Contents |