The ASP-based approach uses two ASP methods on the server page: getObject and Response.Write. The getObject method is used to instantiate a class based on the WFC com.ms.wfc.html classes. The Response.Write method writes the generated HTML string to the client. The com.ms.wfc.html.DhElement class provides a getHTML method that creates the HTML string. This string is then sent to the client page using the ASP Response.Write method.
For example, you have a class called MyServer that extends DhForm and incorporates some HTML elements. In your ASP script, you first call getObject("java:MyServer") to create a DHTML object. You can then perform whatever actions you want on the object from your ASP script, such as setting properties on the object. When you have finished, you call the object's getHTML method to generate the string and pass that result to the ASP Response.Write method, which sends the HTML to the client. The following code fragments show the relevant ASP script and Java code for creating a DhEdit control in HTML and sending it to the client.
// ASP SCRIPT Dim f,x set f = getObject( "java:dhFactory" ) set x= f.createEdit x.setText( "I'm an edit!" ) Response.Write( x.getHTML() ) Response.Write( f.createBreak().getHTML() ) . . . // JAVA CODE public class dhFactory { public dhFactory(){ } public DhBreak createBreak() { return new DhBreak(); } public DhEdit createEdit(){ return new DhEdit(); } }