2025-04-27 07:49:33 -04:00

67 lines
4.8 KiB
HTML
Raw Blame History

<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<META NAME="Generator" CONTENT="Microsoft Word 97">
<TITLE>default</TITLE>
<META NAME="Version" CONTENT="8.0.3410">
<META NAME="Date" CONTENT="10/11/96">
<META NAME="Template" CONTENT="C:\Program Files\Office\Office\HTML.DOT">
</HEAD>
<BODY TEXT="#000000" LINK="#0000ff" VLINK="#800080" BGCOLOR="#ffffff">
<B><FONT FACE="Arial" SIZE=4><P>ASP Java Component Framework</P>
</B></FONT><P>The Active Server Pages Java Component Framework simplifies creating Active Server Components by creating new interfaces that expose the ASP object model. The goal is to retain all of the features and flavor of the ASP Programming model, but to expose it in a way that is more natural for the Java programmer. The classes use native Java types, and support native Java interfaces. So, for example, the Application and Session objects, which allow the programmer to store data and associate it with a name, extend the class java.util.Dictionary, which is the standard Java associative collection class.</P>
<B><FONT FACE="Arial"><P>Reference Pages</P>
</B></FONT><P>The following are links to the Reference pages for the framework classes.</P>
<TABLE CELLSPACING=0 BORDER=0 CELLPADDING=7 WIDTH=638>
<TR><TD WIDTH="33%" VALIGN="TOP">
<P><A HREF="Documentation/Request.htm">Request</A></TD>
<TD WIDTH="33%" VALIGN="TOP">
<P><A HREF="Documentation/Enumerator.htm">Enumerator</A></TD>
<TD WIDTH="33%" VALIGN="TOP">
<P>&nbsp;<A HREF="Documentation/CookieDictionary.htm">CookieDictionary</A></TD>
</TR>
<TR><TD WIDTH="33%" VALIGN="TOP">
<P><A HREF="Documentation/Response.htm">Response</A></TD>
<TD WIDTH="33%" VALIGN="TOP">
<P><A HREF="Documentation/Server.htm">Server</A></TD>
<TD WIDTH="33%" VALIGN="TOP">
<P>&nbsp;<A HREF="Documentation/ObjectDictionary.htm">ObjectDictionary</A></TD>
</TR>
<TR><TD WIDTH="33%" VALIGN="TOP">
<P><A HREF="Documentation/Session.htm">Session</A></TD>
<TD WIDTH="33%" VALIGN="TOP">
<P><A HREF="Documentation/Cookie.htm">Cookie</A></TD>
<TD WIDTH="33%" VALIGN="TOP">
<P>&nbsp;<A HREF="Documentation/RequestDictionary.htm">RequestDictionary</A></TD>
</TR>
<TR><TD WIDTH="33%" VALIGN="TOP">
<P><A HREF="Documentation/Application.htm">Application</A></TD>
<TD WIDTH="33%" VALIGN="TOP">
<P>&nbsp;<A HREF="Documentation/Map.htm">Map</A></TD>
<TD WIDTH="33%" VALIGN="TOP">
<P>&nbsp;</TD>
</TR>
</TABLE>
<B><FONT FACE="Arial"><P>Using the Framework Classes</P>
</B></FONT><P>The framework has been provided in both source code (.java) and compiled byte code (.class) formats. In order to use the classes, though, you'll have to put them in a place that the Java VM can find them. Here's what to do:</P>
<OL>
<LI>Create a new directory, "aspcomp" in your java\trustlib directory. This is most typically found in %windir%\java\TrustLib. Since the framework files have been created in a package called aspcomp, the java vm will expect to find them there.</LI>
<LI>Copy the framework files to the newly created java\TrustLib\aspcomp directory. </LI></OL>
<B><FONT FACE="Arial"><P>Using the Samples</P>
</B></FONT><P>The <I>Additional Samples</I> directory contains sample .java (and .class) files that are based on the framework classes, as well as .asp files that use them. See the <A HREF="Samples/readme.txt">readme.txt</A> file in samples directory for information on how to install these on your system.</P>
<B><FONT FACE="Arial" SIZE=4><P><A NAME="_Toc397403925">Creating Components</A> </P>
</B></FONT><P>First, a little terminology. When we say that we want to build a <I>component</I> in Java, what we mean is that we want to create a single Java class that we will instantiate from ASP as a COM object. We call that class <I>"the component class".</I> It is entirely possible that the component will create other Java objects or COM objects, which it uses internally. So, while the source code for your component might consist of multiple Java source files, there will be a single Java class that represents your component. </P>
<P>Creating components with the Java Framework is very easy, and requires 3 basic steps:</P>
<OL>
<LI>Create the .java file(s) for your component. Make sure that you include the "import aspcomp;" in your source.</LI>
<LI>Compile the files to produce .class files.</LI>
<LI>Register the your component<6E>s Java class with COM, so that it can be created (via COM) from an Active Server Page. You do this by running the javareg.exe tool that comes with the Microsoft SDK for Java. Note that you only need to do this registration once, and you only need to register the class that <I>is</I> your component. The following line shows how to register a component</LI></OL>
<P>javareg /register /class:[&lt;packagename&gt;.]&lt;classname&gt; /progid:&lt;progid&gt;</P></BODY>
</HTML>