If an Oracle ATG Web Commerce server is serving content to a locale other than the server locale, the request must have a locale associated with the content being served. The service OriginatingRequest.requestLocale is an on-the-fly, session-scoped component that provides locale-related information for the duration of a session. When an OriginatingRequest.requestLocale component is first created, it looks through a hierarchy of sources to determine which locale to use for the session. After a Locale object is created, it is stored in the OriginatingRequest.requestLocale component for use by all requests within a visitor session. Because this is an on-the-fly component, you cannot access it within the ATG Control Center. It only exists for the duration of a web site user’s session. You can configure the /atg/dynamo/servlet/RequestLocale component, however, as the OriginatingRequest.requestLocale component searches this component for information about a user’s locale.

When a request reaches the servlet pipeline, the DynamoHandler pipeline servlet adds a RequestLocale component in the requestLocale property of the DynamoHttpServletRequest object. This behavior is controlled by the DynamoHandler’s generateRequestLocales property; the RequestLocale is added to the request object only if generateRequestLocales=true. In an Oracle ATG Web Commerce servlet bean, the DynamoHttpServletRequest object is used to access the RequestLocale object. If a Nucleus component does not have access to the DynamoHttpServletRequest object, the request locale can be accessed by including requestLocale as a property in the component.

When configuring a site’s supported request locales, you must configure components related to the RequestLocale component. For more information on configuring your request locales, see Using the EncodingTyper to Set the Character Encoding in this chapter.

This section describes the OriginatingRequest.requestLocale and RequestLocale services in the following topics: