Endpoints can set the localeHint property of the @Endpoint annotation to let the client know if it must provide a locale for the request. The framework looks for the X-OCAssetLanguage custom request header to get the request locale. If an endpoint uses this locale hint, then any request that gets matched to this endpoint must contain the custom header or the request is rejected.

If the header is not set, the user profile provides the locale. If the user profile does not contain a locale the system checks the locales property in the request and then, if not finding a locale, checks the server locale.

The LOCALE_HINT_ASSET_LANGUAGE_REQUIRED enables endpoints that require the asset to be updated with the correct locale. If an endpoint uses this locale hint, any requests matched to this endpoint must contain the custom header or the request will be rejected. The following is an example of a localeHint:

header(String pName, Object pHeader)
localeHint = RestConstants.LOCALE_HINT_ASSET_LANGUAGE_REQUIRED

Copyright © 1997, 2017 Oracle and/or its affiliates. All rights reserved. Legal Notices