# Class WebClient

java.lang.Object
org.eclipse.rap.rwt.client.WebClient

All Implemented Interfaces:
  `Serializable, Client`

public class WebClient extends Object implements Client
The default RWT web client.

Since:
  2.0
See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`BODY_HTML`
Entrypoint property name for custom HTML code to be placed inside the `body` of the startup page.
`static final String`
`CSP`
Entrypoint property name for specifing the content security policy.
`static final String`
`DISABLE_SHUTDOWN_REQUEST`
Entrypoint property name to disable the shutdown request.
`static final String`
`FAVICON`
Entrypoint property name for the website icon (a.k.a favicon or shortcut icon) that will be displayed by the web browser.
`static final String`
`HEAD_HTML`
Entrypoint property name for additional HTML elements to be added to the <head> section of the startup page.
`static final String`
`PAGE_OVERFLOW`
Entrypoint property name for the page overflow behavior.
`static final String`
`PAGE_TITLE`
Entrypoint property name for the title that will be displayed in the browser window.
`static final String`
`THEME_ID`
Entrypoint property name for a custom theme to be used with the entrypoint.

## Constructor Summary

Constructors
Constructor
Description
`WebClient()`

## Method Summary

Modifier and Type
Method
Description
`<T extends ClientService>
T`
`getService(Class<T> type)`
Returns this client's implementation of a given service, if available.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### THEME_ID

public static final String THEME_ID
Entrypoint property name for a custom theme to be used with the entrypoint. The value must be the id of a registered theme. If omitted, the default theme will be used.

See Also:
  - `RWT.DEFAULT_THEME_ID`
  - `Application.addEntryPoint(String, Class, Map)`
  - `Application.addEntryPoint(String, EntryPointFactory, Map)`
  - Constant Field Values

### HEAD_HTML

public static final String HEAD_HTML
Entrypoint property name for additional HTML elements to be added to the <head> section of the startup page. The value must contain a valid HTML snippet that consists only of HTML elements that are permissible sub-elements of `head` such as `meta` or `link`.

Warning: the property value will not be validated by the framework. Invalid HTML can break the application entirely or lead to problems that are hard to identify. It's the responsibility of the developer to ensure the correctness of the resulting page.

See Also:
  - `Application.addEntryPoint(String, Class, Map)`
  - `Application.addEntryPoint(String, EntryPointFactory, Map)`
  - Constant Field Values

### BODY_HTML

public static final String BODY_HTML
Entrypoint property name for custom HTML code to be placed inside the `body` of the startup page. The value must be proper HTML 4.0 in order not to break the surrounding page.

Warning: the property value will not be validated by the framework. Invalid HTML can break the application entirely or lead to problems that are hard to identify. It's the responsibility of the developer to ensure the correctness of the resulting page.

See Also:
  - `Application.addEntryPoint(String, Class, Map)`
  - `Application.addEntryPoint(String, EntryPointFactory, Map)`
  - Constant Field Values

### PAGE_TITLE

public static final String PAGE_TITLE
Entrypoint property name for the title that will be displayed in the browser window. The value must be the title string without any HTML markup.

See Also:
  - `Application.addEntryPoint(String, Class, Map)`
  - `Application.addEntryPoint(String, EntryPointFactory, Map)`
  - Constant Field Values

### PAGE_OVERFLOW

public static final String PAGE_OVERFLOW
Entrypoint property name for the page overflow behavior. The value must be one of the "scroll", "scrollX", "scrollY". If this property is not set the page overflow is disabled.

Since:
  3.1
See Also:
  - `Application.addEntryPoint(String, Class, Map)`
  - `Application.addEntryPoint(String, EntryPointFactory, Map)`
  - Constant Field Values

### FAVICON

public static final String FAVICON
Entrypoint property name for the website icon (a.k.a favicon or shortcut icon) that will be displayed by the web browser. The value must contain a valid path where the image can be accessed on the server.

Note: if this property is provided, the image resource must be registered to be available. Favicons are usually expected to be 16x16 px in size. If the icon has to work with legacy browsers, use a file in the ICO format.

See Also:
  - `Application.addResource(String, ResourceLoader)`
  - `Application.addEntryPoint(String, Class, Map)`
  - `Application.addEntryPoint(String, EntryPointFactory, Map)`
  - Constant Field Values

### CSP

public static final String CSP
Entrypoint property name for specifing the content security policy. The value must contain a valid string with content security policy directives.

Note: Use "nonce-" without random value in your "script-src" directive. The nonce value will be appended dinamically. Example: "script-src 'strict-dynamic' 'nonce-' 'unsafe-eval' http: https:; object-src 'none'; base-uri 'none';"

Since:
  3.21
See Also:
  - `Application.addEntryPoint(String, Class, Map)`
  - `Application.addEntryPoint(String, EntryPointFactory, Map)`
  - Constant Field Values

### DISABLE_SHUTDOWN_REQUEST

public static final String DISABLE_SHUTDOWN_REQUEST
Entrypoint property name to disable the shutdown request. Accepts only "true" as property value.

Since:
  3.22
See Also:
  - `Application.addEntryPoint(String, Class, Map)`
  - `Application.addEntryPoint(String, EntryPointFactory, Map)`
  - Constant Field Values

## Constructor Details

### WebClient

public WebClient()

## Method Details

### getService

public <T extends ClientService> T getService(Class<T> type)
Description copied from interface: `Client`
Returns this client's implementation of a given service, if available.

Specified by:
  `getService` in interface `Client`
Parameters:
  `type` - the type of the requested service, must be a subtype of ClientService
Returns:
  the requested service if provided by this client, otherwise `null`
See Also:
  - `ClientService`