File Expiration Sample

This Sample is located at \Samples\ASP.

Description
Using the Sample
Key Project Files
Technologies Demonstrated

Description

This sample demonstrates how the ASP Java Component Framework can be used to easily access the built-in ASP objects. In the Accessing Built-In ASP Objects sample, the built-in ASP objects were accessed through the underlying COM interfaces. This sample, however, uses the higher-level, powerful framework interfaces and methods.

This sample’s component implements a single class, ExpirePage, which exposes one method, expireAtYearEnd. This method invokes the AspContext.getResponse method to gain access to the Response object. Response.setExpiresAbsolute is then used to set the absolute expiration date of the HTTP response to one year from the present date. A message, informing the client browser of the expiration setting, is sent using the Response.Write method.

Using the Sample

See Using the ASP Samples for instructions on installing, running, and uninstalling this sample.

Key Project Files

ExpirePage.java

The main method of this class calculates the beginning of the next year by setting the page’s cache expiration date.

ExpirePage_test.asp

This file uses the framework to manipulate date and times.

Technologies Demonstrated

ASP

This sample shows how to:

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