Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: for the plan.

Jump to: navigation, search


< Scout‎ | Concepts
Revision as of 01:55, 11 October 2014 by (Talk | contribs) (Path: /ajax)

The Scout documentation has been moved to A Scout server application provides a set of servlets.

Servlets Extension point

The server runs into an OSGi container. The servlet are registered by using the org.eclipse.equinox.http.registry.servlets extension point. For each servlet you want to have in your application you need to defined them in the plugin.xml of your server application.

For example:


The registration maps together the path that need to be called (alias) and a java class (extending javax.servlet.Servlet) that will handle the HTTP request. It is also possible to initialize the servlet with some parameters.


This is the main Servlet of a scout server application.

Path: /process

This is the main entry point for client-server The Scout documentation has been moved to The The Scout documentation has been moved to calls the servlet on the /process path.

Usually the Tunnel is configured in the Client Session. The URL to this path is defined in the server.url property.

If called from a browser, this Servlet will provide some useful information and configuration possibilities.

Scout MiniCRM ServiceTunnelServlet Process.png

  • General: you can find here some general informations (Session, Jaas context, product id)
    • Monitoring: you can activate or deactivate the monitoring of your application
    • Log level: you can change the log level on the fly.
  • Services: Description of the different services served by the scout Server. For each service the class and interface hierarchy is provided and the list of available operations on this service (with the corresponding method signature). The services are classified like this:
    • Outline Services
    • Lookup Services
    • Common Services
    • Other Services

Path: /ajax

On the /ajax path, the ServiceTunnelServlet is also registred. The difference to /process is that no security filter for authentication are registered.

When the Scout application is deployed as webapplication (RAP UI), there are two servers:

  • the scout-server like for the other UIs.
  • the RAP-server that is also the scout-client.

In this configuration, authentication should happend on the RAP-server. It is expected that the scout client put a Subject on the Session. In this case, the client can call this specific backend (without any authentication).


This servlet is useful to serve some resources. This servlet expect some arguments:

  • bundle-name: the name of the bundle where the resource is
  • bundle-path: the path within the bundle where the resource is

Path: /

When they are created with the new scout project wizard, the server application contains an html index page, located here: {server bundle}/resources/html This page is served with a ResouceServlet registered like this in the plugin.xml:


As a result the {server bundle}/resources/html/index.html is served as default page in the server application:

MiniCRM ResourceServlet IndexHtml.png


Link with Remote File

Diagnostic Servlet

Introduced with Scout 3.10 this servlet displays some diagnostic information. This creates an html page with diagnostic information like JVM Memory allocation and cpu architecture. It is also possible to add diagnostic information from any class entity. If an Entity wants to provide diagnostic status info it has to implement org.eclipse.scout.rt.server.admin.diagnostic.IDiagnostic and has to register itself at the DiagnosticFactory: org.eclipse.scout.rt.server.admin.diagnostic.DiagnosticFactory.addDiagnosticStatusProvider() and org.eclipse.scout.rt.server.admin.diagnostic.DiagnosticFactory.removeDiagnosticStatusProvider()

Here an example how you can it under the /info path:


Here a preview how it could looks like (depending on the registered Diagnostic entities):

Eclipse Scout-LunaM4-Diagnostics.png

Custom servlet

Of course you can write your own servlet and register it.

Here an example of a servlet returning as JSON string the list of all osgi-bundles contained in the server:

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.scout.rt.server.commons.servletfilter.HttpServletEx;
import org.eclipsescout.demo.minicrm.server.Activator;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
 * Example Servlet:
 * Provides the list of the installed bundle as JSON String.
public class BundleListServlet extends HttpServletEx {
  private static final long serialVersionUID = 1L;
  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    try {
      BundleContext context = Activator.getDefault().getBundle().getBundleContext();
      PrintWriter out = response.getWriter();
      out.print("\"bundles\": [");
      boolean first = true;
      for (Bundle b : context.getBundles()) {
        if (first) {
          first = false;
        else {
          out.print(" , ");
        out.print("{ \"Symbolic Name\": \"" + b.getSymbolicName() + "\",");
        out.print("\"Version\": \"" + b.getVersion().toString() + "\"}");
      out.print(" ] ");
    catch (IOException e) {

You need to register it (for example on the /bundles path):



For each of the servlet you need to define who is allowed to call it. This is realized with a combination of The Scout documentation has been moved to

See Also

Back to the top