The DataDome Developer Hub

Welcome to the DataDome developer hub. You'll find comprehensive guides and documentation to help you start working with DataDome as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Java Module Setup


The DataDome Java Module is a custom servlet filter which intercepts the request and response and sends it to DataDome servers to detect bot traffic.


With Maven

            <name>DataDome bintray repo</name>

Manual Installation

  1. Download archive
  1. The downloaded zip file includes sources, so you can directly install it to your local maven repository:
    mvn install

By default it build with servlet-api-3.1 and if you're used application server with servlet-api-3.0
you should build it by hands with different profile:

mvn -P servlet-api-3.0 install


Filter has been tested on jetty and should work with Jboss and other servers supporting servlet api.

To use the filter you just need add it to web.xml as first server.

For eample:


You can also specified additional parametrs likes hostname or timeout.

List of possible init parametrs:

Settings Description Default
datadome.apikey License key to access API
datadome.hostname Hostname of API server
datadome.ssl Use SSL between the filter and the API server true
datadome.regex Inclusion regex ""
datadome.exclusion_regex Exclusion regex \.(js|css|jpg|jpeg|png|ico|gif|tiff|svg|woff|woff2|ttf|eot|mp4|otf)$
datadome.connection_timeout Connection timeout (in ms) 150
datadome.read_timeout Read timeout (in ms) 50
datadome.max_connections Maximum open connection to the API server 100

You can use environment variables inside DataDome filter's param-value.

For example if you have system environment variable DATADOME_API_KEY with your API key, you can put to web.xml:



How can I log the time spent calling DataDome API?

DataDome filter adds attribute datadome.spent_time (number of milliseconds spent for
building request/getting response from DataDome API) so it could be easily retrieved inside your servlet.

Here is how you can use it:

    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.getWriter().println("Example servlet");
        System.out.println("Time spent by DataDome:" + req.getAttribute("datadome.spent_time"));

Note : the above example is for demonstration purposes only.
Your use case could be different for example sending spent_time value to your monitoring system etc.

Java Module Setup