Answer the question
In order to leave comments, you need to log in
How to call a method on a ServletContext object?
Hello, in many examples I saw how the following code is present for the authentication filter settings
private static boolean hasUrlPattern(ServletContext servletContext, String urlPattern) {
Map<String, ? extends ServletRegistration> map = servletContext.getServletRegistrations();
Answer the question
In order to leave comments, you need to log in
Solution found, I used too old versions
javaee-apiand
javax.servlet-apithe first one had a version below 8th and the second one had a version below 3rd,
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<scope>provided</scope>
</dependency>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question