ASP Java Component Framework Samples

The ASP samples that demonstrate test components for the ASP Java Component Framework are shown in the following table.

Accessing Built in ASP Objects Demonstrates how a Java class directly calls ASP objects.
Binary Data Output Demonstrates how to use the framework to output binary data.
File Expiration Demonstrates how Java dates can now be used with ASP, in this case to set the page cache expiration date.
Forms and Cookies Shows how a Java class accesses form variables, cookies, and so on with the Java ASP Component Framework.
HelloWorld Displays a simple Java class.
Java and Tables Demonstrates how to stream out an HTML table based on attributes set by the caller.
Server Variable Enumeration Demonstrates how to use the framework to access HTTP server variables.

Using the Samples

The following instructions apply to all ASP samples.

To run the samples

Important   To run these samples, you must have a Web browser that supports ASP (such as Microsoft® Internet Explorer 4.0 or later).

  1. Install the Internet Information Server and the com.ms.iis.asp package from the Microsoft SDK for Java. To install the com.ms.iis.asp package on Windows 2000 machines, run IntegrationClasses2000.exe, which is located in the %SDKDIR%\Bin directory. To install this package on versions of Windows prior to Windows 2000, run IntegrationClasses.exe, which is also located in the %SDKDIR%\Bin directory.

  2. Compile the *.java files. Use iiscomp.cmd in the \IISSample directory to compile the ASP classes and aspcomp.cmd in the \aspcomp directory to compile the framework classes. \IISSample and \aspcomp are subdirectories of %Windir%\Java\Trustlib.

    Note   If you are working in Microsoft® Visual J++®, you must install the new Java compiler from the Microsoft SDK for Java. This means copying jvc.exe, jps.dll, and msjvc.dll from the SDK's installation into your DevStudio\SharedIDE\bin directory. You must also set the destination for the project (Project/Properties/Compile/Output Directory) to the %WINDIR%\java\trustlib directory.

  3. Alternatively, you can use the pre-built *.class files provided in the %SDKDIR%\Samples\ASP\IISSample folder. To do this, copy *.class into the %WINDIR%\java\trustlib\IISSample directory. You must also copy the classes in %SDKDIR%\Samples\ASP\aspcomp to the %WINDIR%\java\trustlib\aspcomp directory.

  4. Configure a virtual root on your host server.
    1. Double-click your host machine in your IISManager, and then right click the default Web page.

    2. Select New, and then choose Virtual Directory.

    3. In the wizard, enter all required information.

    4. When prompted for the path, specify the directory on your drive that contains the files from IISSample.

    5. Check Read and Run Scripts to enable ASP.
  5. Run regit.cmd, which registers your components with COM. This assumes that javareg is on your path. Javareg comes with both Visual J++ and the Microsoft SDK for Java.

  6. Start the Web server.

  7. Change to the directory that contains the *.asp file (ASP Samples) in your IISManager, right-click the directory, and then choose Browse. This will load the ASP page.

To uninstall the samples

Delete the *.class files from your %WINDIR%\java\trustlib\IISSample directory.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.