uCosminexus Application Server, Web Service Development Guide
![[Contents]](FIGURE/CONTENT.GIF)
![[Glossary]](FIGURE/GLOSS.GIF)
![[Index]](FIGURE/INDEX.GIF)
![[Back]](FIGURE/FRONT.GIF)
acceptLanguage(String... locales) method
Description
This method adds a receivable language.
Syntax
public WebResource.Builder acceptLanguage(String... locales)
Parameter
- locales
- This is an array of the receivable languages.
Return value
The method returns a builder (WebResource.Builder object) to set up the 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 specified value is set as is in the Accept-Language HTTP header. The JAX-RS engine does not validate the specified value. Specify the 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
acceptLanguage(Locale... locales) method
acceptLanguage(String... locales) method
header(String name, Object value) method
- WebResource class
acceptLanguage(Locale... 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(String... 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.