All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sentry.servlet.jakarta.SentryServletContainerInitializer Maven / Gradle / Ivy

The newest version!
package io.sentry.servlet.jakarta;

import com.jakewharton.nopen.annotation.Open;
import io.sentry.SentryIntegrationPackageStorage;
import jakarta.servlet.ServletContainerInitializer;
import jakarta.servlet.ServletContext;
import jakarta.servlet.ServletException;
import java.util.Set;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * Servlet container initializer used to add the {@link SentryServletRequestListener} to the {@link
 * ServletContext}.
 */
@Open
public class SentryServletContainerInitializer implements ServletContainerInitializer {
  @Override
  public void onStartup(@Nullable Set> c, @NotNull ServletContext ctx)
      throws ServletException {
    ctx.addListener(SentryServletRequestListener.class);
    SentryIntegrationPackageStorage.getInstance().addIntegration("Servlet-Jakarta");
    SentryIntegrationPackageStorage.getInstance()
        .addPackage("maven:io.sentry:sentry-servlet-jakarta", BuildConfig.VERSION_NAME);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy