Getting Site Information

Given a valid site ID, the servlet bean GetSiteDroplet returns a site object—an implementation of interface atg.multisite.Site—which encapsulates a site configuration. The output parameter enables access to that site’s properties. If you supply null for the site ID, GetSiteDroplet returns the current site.

The following JSP code uses GetSiteDroplet to obtain the site mySite’s configuration. The output parameter site provides access to all site configuration properties. In this example, the code obtains the site’s closingDate property and compares it to the current date to determine whether the site is active:

Getting the Current Site

You can obtain the current site and its configuration through the request-scoped Nucleus component /atg/multisite/Site. For example, you can modify the previous example and obtain the current site’s closingDate property as follows: