spring-security-samples icon indicating copy to clipboard operation
spring-security-samples copied to clipboard

Servlet sample not working in Tomcat 10 and 11

Open afattahi54 opened this issue 9 months ago • 0 comments

I tried to run the sample in servlet/java-configuration/hello-security-explicit on Tomcat 10 and Tomcat 11 . But no luck. It seems that SecurityWebApplicationInitializer is not called ( I am using maven to get project libs)

To debug further, I try to print the list of application filters ( by using context.getFilterRegistrations() ) but the spring filters are not shown.

My web.xml:

<web-app
    xmlns="https://jakarta.ee/xml/ns/jakartaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
    version="6.0"
    >
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>
	<listener>
		<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
	</listener>
</web-app>

Am I missing something ?! Is this sample suppose to be run on Tomcat whiteout any changes ?

afattahi54 avatar Feb 01 '25 09:02 afattahi54