--- title: "Adding a server context (HTTP server)" slug: "add-server-context" updated: 2026-06-09T08:53:00Z published: 2026-06-09T08:53:00Z canonical: "docs.lobstersoftware.com/add-server-context" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # Adding a server context (HTTP server) A context is a subarea within the HTTP server to which web applications, servlets or other elements can be added. This allows you to structure your content. The following XML fragment sets up a context. ```xml /service/* [context specific calls and definitions] ``` The first parameter allows to designate a virtual host to which the context is assigned exclusively. If there is no restriction on a particular virtual host, then the specification of the *NullClass* is necessary, as can be seen in the XML code shown above. The second parameter is the name of the context as it should appear in the URL. URLs that address the context as defined above would have the following structure. | http:///service/... | | --- | The calls and definitions that are possible after adding a context are very numerous. Therefore, only the most important sections for the operation of the Integration Server are described here. ## Setting the resource base If you want to use a directory different from the working directory to obtain resources within a context, you can set this with the following XML fragment. ```xml ./myotherdir ``` The directory can be specified relative to the working directory of the Integration Server or absolute. ## Adding a resource handler to a context A resource handler is responsible for delivering resources, i.e. HTML pages, images, etc. Without an added resource handler, it is not possible to deliver such static items. The following XML fragment adds a resource handler to the context. ```xml ``` Before setting a resource handler, a suitable resource base should have been defined. ## Adding a servlet to a context The following XML fragment adds a servlet to the current context. ```xml Servletname /ServletContext/* com.ebd.dummy.servlet.MySpecialServlet ``` Where *Servletname* is the name of the servlet, such as it should appear in the information area. *ServletContext* is the context in which the servlet should be offered. It will be appended to the context to which the servlet is added (here *service*). The third parameter is the fully qualified class name of the servlet. URLs that address the servlet as defined above would have the following structure. | http:///service/ServletContext/path/info?key1=val1 | | --- | ## Enabling a user authentication To enable user authentication, it is necessary to have previously added a realm definition. The following XML fragment activates the HTTP Basic Authentication for the selected context. ```xml Admin Realm ``` The parameter specifies the name of the realm, as it was previously defined when adding. ## Adding a single web application The following XML fragment adds a single web application to the server. ```xml /context ./webapps/webappdir false etc/webdefault.xml 127.0.0.1 localhost www.lobster.de ``` The arguments/parameters have the following meaning. | Argument/Parameter | Description | | --- | --- | | | The context to use for this web application. If *null* is specified, the base context is used. | | | The directory where the web app files are located. | | extractWAR | Determines whether the found WAR file should be extracted to a temporary directory or not. | | defaultsDescriptor | The XML file that configures the web service. | If the web application is to be restricted to specific virtual hosts, this can be done with the XML fragment above. ## Adding a web application directory The following XML fragment defines a base directory for adjustable web applications. ```xml ./webapps/ etc/webdefault.xml true ``` The first parameter is the possibly set virtual host for which the web application directory should be valid or the *NullClass* entry if the directory of the respective HTTP server is to be used. The remaining parameters are identical to the parameters already described for adding a single web application.