Adding a server context
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.
<
Call
name
=
"addContext"
>
<
Arg
>
<
New
class
=
"com.ebd.hub.xml.NullClass"
/>
</
Arg
>
<
Arg
>/service/*</
Arg
>
[context specific calls and definitions]
</
Call
>
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://<myserver>/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.
<
Set
name
=
"ResourceBase"
>./myotherdir</
Set
>
The directory can be specified relative to the working directory of the Integration Server or absolute.
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.
<
Set
name
=
"realmName"
>Admin Realm</
Set
>
<
Set
name
=
"authenticator"
>
<
New
class
=
"com.ebd.hub.server.http.BasicAuthenticator"
/>
</
Set
>
<
Call
name
=
"addHandler"
>
<
Arg
>
<
New
class
=
"com.ebd.hub.server.http.handler.SecurityHandler"
/>
</
Arg
>
</
Call
>
The parameter specifies the name of the realm, as it was previously defined when adding.