getApplication

The getApplication method of the AspContext class creates an instance of the Application object.

public static Application getApplication();

Example

The following code accesses the staticObjects property of the Application object. If objects have been added to the Application object with the <OBJECT> tag, the checkforstatic method returns true; otherwise it returns false.

import com.ms.iis.asp.*;
import com.ms.mtx.*;
public class wfctestmain
{
  public boolean checkforstatic()
  {
Application myapp = 
AspContext.getApplication ();
     ObjectDictionary mydict = myapp.staticObjects;
     if (mydict.isEmpty())
      {
//There isn’t anything in the staticObjects 
          return true;
     }
     else 
    {
         //there's at least one object
         return false;
   }
  }
}

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