uCosminexus Application Server, Web Service Development Guide
![[Contents]](FIGURE/CONTENT.GIF)
![[Glossary]](FIGURE/GLOSS.GIF)
![[Index]](FIGURE/INDEX.GIF)
![[Back]](FIGURE/FRONT.GIF)
acceptLanguage(Locale... locales) method
Description
This method adds a receivable language.
Syntax
public T acceptLanguage(Locale... locales)
Parameter
- locales
- This is an array of the receivable languages.
Return value
This method returns a builder (WebResource.Builder object) to set up a WebResource object.
Notes
- The non-null value in the locales parameter is added in the Accept-Language HTTP header. A null value is ignored and is not added in the Accept-Language HTTP header.
- The value returned by the toString() method of the Locale object is set in the Accept-Language HTTP header. The JAX-RS engine does not validate the values returned by the toString() method. Specify a value according to the standard specifications.
- You can also use the following methods to add the value of the Accept-Language HTTP header:
- ClientRequest.Builder class
header(String name, Object value) method
acceptLanguage(String... locales) method
- WebResource class
acceptLanguage(Locale... locales) method
acceptLanguage(String... locales) method
header(String name, Object value) method
- WebResource.Builder class
acceptLanguage(Locale... locales) method
acceptLanguage(String... locales) method
header(String name, Object value) method
The operation when no receivable language is added with these methods and the acceptLanguage(Locale... locales) method is the same as the operation when the Accept-Language HTTP header is not added in the HttpURLConnection object before performing HTTP communication.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.