> For the complete documentation index, see [llms.txt](https://docs.tomorrowx.com/cap/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tomorrowx.com/cap/product-reference/installation-and-configuration/installing-inline-with-an-existing-application.md).

# Installing Inline with an Existing Application

This option is the highest performing and involves installing the <code class="expression">space.vars.X\_Product\_Name</code> server inline with an existing Web application. This is accomplished using a servlet filter and works with all Java application servers that support the servlet specification 2.3 or later.

To install inline, copy the file `magic-11.0.jar` from the `\integration-examples\jars` folder under the <code class="expression">space.vars.X\_Product\_Name</code> Server installation to the WEB-INF\lib folder of the target Web application.

Once the copy is completed, you need to update your WEB.XML file to ensure that the <code class="expression">space.vars.X\_Product\_Name</code> server is started with your target application and is correctly sitting inline before your HTTP request processing by servlets or JSPs.

To do this, edit the `WEB.XML` file and insert the lines highlighted below:

<figure><img src="/files/PXcO5vwonZV5uukRHm5M" alt=""><figcaption><p>web.xml file</p></figcaption></figure>

If you already have filters installed with your target application, you can place the <code class="expression">space.vars.X\_Product\_Name</code> filter anywhere in the chain that is appropriate. Please note that some application servers (such as IBM WebSphere) require all filters to be listed before the full list of filter mappings. Failure to follow this rule can cause the Web application to fail to load.

Once the files are in place, you must copy the `magic.properties` file from the `\integration-examples\configuration` folder under your <code class="expression">space.vars.X\_Product\_Name</code> Server installation to the `WEB-INF\classes` folder on your target system. Edit it to suit the configuration being created. As a minimum, you will need to provide a home folder. This should be an empty folder on the local file system that the server has authority to read, write and update. Please see the section [**Understanding the magic.properties configuration settings**](/cap/product-reference/installation-and-configuration/understanding-the-magic.properties-configuration-settings.md) for more detailed explanations of the configuration settings.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.tomorrowx.com/cap/product-reference/installation-and-configuration/installing-inline-with-an-existing-application.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
