# ServiceHandler

###### Identifier:

org.eclipse.rap.ui.serviceHandler

###### Since:

RAP 1.3

###### Description:

A service handler can be used to process custom requests, e.g. to deliver files, images or other content to the client. Service handlers are called in the user's session scope, i.e. they can access session information. They can be implemented like servlets, i.e. they can access headers and parameters from the request object and write the result into the reponse writer or output stream. A service handler can be accessed by a URL with a specific parameter. This URL can be obtained from `RWT.getServiceManager().getServiceHandlerUrl( "download" )`

###### Configuration Markup:

<!ELEMENT extension (serviceHandler+)+>

<!ATTLIST extension

point CDATA #REQUIRED

id CDATA #IMPLIED

name CDATA #IMPLIED>

<!ELEMENT serviceHandler EMPTY>

<!ATTLIST serviceHandler

id CDATA #REQUIRED

class CDATA #REQUIRED>

- id - A unique ID for this service handler. This ID is used to obtain the URL to access the service handler.
- class - The service handler implementation.

###### Examples:

Here's an example of an extension that registers two service handlers:

    <extension point="org.eclipse.rap.ui.serviceHandler">
      <serviceHandler
          class="org.eclipse.rap.ui.impl.ServiceHandler1"
          id="myHandler1">
      </serviceHandler>
      <serviceHandler
          class="org.eclipse.rap.ui.ServiceHandler2"
          id="myHandler2">
      </serviceHandler>
    </extension>

Copyright (c) 2008, 2015 EclipseSource and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html