This sample demonstrates how easily the Java Component Framework can be used to easily access the built-in ASP objects. In the Accessing Built-In ASP Objects, the built-in ASP objects were accessed through the base, underlying COM interfaces. This sample, however, uses the higher-level, powerful framework interfaces and methods.
This sample component implements a single class, ExpirePage, which exposes one method, expireAtYearEnd. When called, the expireAtYearEnd 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 expiry setting, is sent using the Response.Write method.
This project is available in the ...\iissamples\sdk\components\java\Samples subdirectory of the Internet services directory.