Normally I would have added org.springframework.web.filter.DelegatingFilterProxy
with a snippet like this to web.xml:
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>
org.springframework.web.filter.DelegatingFilterProxy
</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
But with Servlet 3.0 Container and Jetty, I've removed web.xml. I'm trying to add DelegatingFilterProxy to Jetty's launch with:
context.addFilter(DelegatingFilterProxy.class, "/*", EnumSet.allOf(DispatcherType.class));
but I get error:
No bean named 'org.springframework.web.filter.DelegatingFilterProxy-100555887' is defined
How am I supposed to create and add this filter?
context.addFilter(new FilterHolder(new DelegatingFilterProxy("springSecurityFilterChain")), "/*", EnumSet.allOf(DispatcherType.class));
seems to be the correct syntax.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With