Using Java From Dreamweaver
By Pete Kobak
Macromedia's Dreamweaver 2 lets you design Web pages with customized components. You can customize the interface to these components to specify the exact look and feel of the choices presented. While this customization is powerful, Macromedia also lets you extend Dreamweaver's JavaScript into C language libraries. By using this "escape into C," Dreamweaver can be extended with any other language that can interface with C.
I'll show you an example of this extensibility by providing a link to Java code. We'll use a Windows DLL written in C to allow Dreamweaver JavaScript to call, and retrieve values from, static methods in Java. First, I'll go step-by-step through a minimal example; then I'll show you a more robust interface with sufficient error checking to catch the inevitable mistakes we make while developing.
I'll assume that you already have Dreamweaver and Java installed and working; I won't be writing much about Dreamweaver or Java individually, focusing instead on the connection between the two.
Why Connect to Java?
You can't store data outside Dreamweaver using JavaScript, which can limit your ability to create complex component models. Going into the world of Java lets you take advantage of a full-featured language, most importantly using Java's data persistence tools: object Serialization, JDBC, Remote Method Invocation (RMI), or just writing plain old files. By calling Java code, you can get persistence without having to code down at the C level.<>