# Servlet Filter

Installing the <code class="expression">space.vars.X\_Agent\_Name\_Single</code> as a Servlet filter in a Java Application Server *(such as Jetty, WebSphere, JBoss etc.)*, is a common approach. In this scenario, the <code class="expression">space.vars.X\_Agent\_Name\_Single</code> is acting like a Servlet Filter sees all requests coming in and has the ability to modify the request before it reaches the web application. Similarly, is also sees every response coming back from the web application and it has the ability to modify these responses on the fly.

<figure><img src="/files/Hmmd5yTQK82RKqJxeY7S" alt=""><figcaption><p>Graph</p></figcaption></figure>

Use cases for this approach mostly centre around making temporary changes to an existing web application, out of band of release cycles, or when the web application is third party and not able to be modified.

Examples of such temporary changes include:

* Adding security such as CSRF or SQL Injection protection
* Frequently changed compliance rules that can be required on short notice


---

# Agent Instructions: 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:

```
GET https://docs.tomorrowx.com/cap/product-reference/architectural-scenarios/servlet-filter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
