Skip Navigation Links
PRODUCTS:
  • Active Log

  • Active Log application with intuitive user interface is a tool for getting real-time output from web application or Flash media.
  • cryobios.com

  • cryobios.com is a free service that allows users to upload applications, ringtones, and images to their mobile phones.
  • Products
  • Java Applet Logging 13/12/2007

    Introduction

    Many web applications use the Applet client. With this type of client, the user accesses an Application Server through the Java Applet in the HTML document. Because Applets restrict using files for trace output all tracing and logging for Java applets are available through the Java console window on the browser. An alternative way to log messages from Java applets is using Active Log application. This aticle gives some ideas and provides online demo how to trace and log Java applets using Active Log.

    How to use the Active Log

    Active Log is a Windows ActiveX application. It can be launched in Internet Explorer browser through JavaScript by calling the ActiveXObject object constructor:

    var ActiveLog = 
            new ActiveXObject("VAALOG.ActiveLog");
    

    Use the LogData method to write a message to Active Log:

    ActiveLog.LogData(message,title);
    

    Parameters

    message Text message to be logged.
    title Message title that is displayed in the message list pane.

    Returns

    Nothing

    Internet Explorer allows communication between Java Applet and JavaScript through the Java wrapper class netscape.javascript.JSObject. In general, applets access JSObject through the static method getWindow which returns a JSObject representing the Window object in the JavaScript for the window containing the given applet. This method takes java.awt.Applet as parameter. Once this Window JSObject is obtained, the applet can call JavaScript functions on an HTML page using call method. The Java code below demonstrates this approach.

    JSObject win = (JSObject)JSObject.getWindow(this);
    win.call(String methodName, Object args[]);
    

    Live Demo

    This live demo demonstrates how Active Log can be used to log messages from Java Applet.
    Note    This demo works in IE browser only.

    Click Proceed To Demo to launch the demo.

    Attach Active Log to Java Applet

    Please follow these steps to implement this demo example:

    1. Install Active Log.
    2. Include the jaws.jar (or plugin.jar if there's no jaws.jar) package from the lib of the JRE in the CLASSPATH to compile demo Applet.

      This is the completed Java Applet code :


    3. Add the mayscript attribute to the applet tag to enable JSObject support in Java Plug-in. HTML will look like this:


    4. Within the head tag of the HTML, insert the JavaScript jsoActiveLog function used to interact with the Java Applet and pass messages to the Active Log.

      This is the completed JavaScript placed in the HTML head:

    Conclusion

    The Java console window already provides support for applets tracing and logging. However, several factors make Active Log a suitable technology for logging messages in real-time. In this article, we've covered the basics of using Active Log, and we've seen the example of a plugging Active Log to Java Applet step by step. Many developers and system administrators can benefit from its use.

    Related Links
    How to use Active Log
    How to use Active Log
    How Java to Javascript Communication Works in Java Plug-in
    How Java to Javascript Communication Works in Java Plug-in
  • Featured Content
  • Active Log Description
    ActiveLog is the visual event tracking (logging) and analizing application that is a perfect tool for Web developers for tracking XML, HTML and text files...
    more»

    Java Applet Logging
    Java Applets tracing and logging using Active Log.
    more»

    Adobe Flash Logging with Active Log
    This is a step-by-step article that will guide you through the entire process of using VATech System's Active Log to log messages from Flash movie during runtime.
    more»

  • News & events
  • 13/04/2011  -  No more relying on Newspaper Classified as the latest Android application “Sneak Jobs” is bound to become a sure shot winner with the masses
    more»

    22/07/2009  -  ActiveLog is now available as open source
    more»

    04/09/2007  -  Active Log is a new product just released by VATech Systems. Built for logging data messages, Active Log is simple to install and plug into client side scripting engine. It could be used by Action Script.
    more»