Counter Applet

Last update : Feb 12, 2000


A. Applet/CGI version

HelloCounter Applet Running Example

Applet source

CGI source


B. Client/Server version

Server part sources

Client part sources

Common sources

How to install

  1.  First modify source as indicated above,
  2.  Locate each source file as follows.

  3. If you want to locate in 'src' directory put each source files in following directory.
  4. Change directory to src. Compile each source files. Confirm classpath includes '.' directory.
  5. and then put compiled class files as follows.

  6. If you want to install in 'classes' directory put each compiled files in following directory.
  7.  Then in <applet> tag specify codebase=classes and code=yoonforh.generic.HelloCounter. Run and test the counter applet.

  8. e.g.)
    <APPLET codebase="classes" code=yoonforh.generic.HelloCounter width=500 height=30 alt="Hello Counter">
    <PARAM name="HOST" value="your.host.name"> <! Please change the value your.host.com with the IP address of the host where the server runs>
    <PARAM name="DATA" value="homepage"> <! Please change the value homepage with what describes your page. This will be used as a part of filename where count data is stored>
    <PARAM name="DELAY" value=3>
    <PARAM name="SINCE" value="06/10/97"> <! Please change the value 06/10/97 with the opening date of your page>
    <PARAM name="MESSAGE" value="Welcome to my Home!">
    <PARAM name="BGCOLOR" value="255, 255, 255">
    <PARAM name="FGCOLOR" value="255, 0, 255">
    <PARAM name="SHCOLOR" value="200, 200, 200">
    <BLOCKQUOTE>
    <B>This page is <BLINK>Java-Powered</BLINK>. So it requires Netscape 2.0 or later. </B>
    </BLOCKQUOTE>
    </APPLET>
  9. Run counter server

  10. In shell(dos) prompt, go to the directory classes and type 'java yoonforh.generic.GenericServer'.
    If it doesn't work check CLASSPATH and PATH environment.
    CLASSPATH should include '.'(current directory) and 'jdk/lib/classes.zip'(here, jdk is the path where you installed jdk)
    PATH should include 'jdk/bin'(here, jdk is the path where you installed jdk)
  11. Run appletviewer or java-enabled browser and visit this page.

  12. NOTE: This requires a socket connection so, HOST value should be the host name of URL in browser.
    If you use netscape navigator, you can use file:/// URL(i.e. Can use 'Open File') with HOST value '127.0.0.1'.
    Otherwise you should run a web server on your host!