Spring Framework 6.2.0-M2 available now

Releases | Brian Clozel | May 16, 2024 | ...

We are happy to announce the availability of the second milestone of Spring Framework 6.2.

In case you missed it, we previously kicked off this milestone phase with 6.2.0-M1 and talked about the "little improvements" we worked on and how bean overriding in tests has evolved.

Spring Framework 6.2.0-M2 is available from repo.spring.io/milestone now, with over 30 improvements and new features.

UrlHandlerFilter for trailing slash match

With the tailing slash match option being deprecated, the Spring community requested a way to gracefully handle this transition period in large applications. We have just introduced the new UrlHandlerFilter for that.

You can configure it to redirect requests to their no-trailing-slash URL equivalent:

UrlHandlerFilter filter = UrlHandlerFilter.trimTrailingSlash("/path/*").andRedirect(HttpStatus.PERMANENT_REDIRECT).build();

Or transparently handle those for HTTP clients, without any redirect:

UrlHandlerFilter filter = UrlHandlerFilter.trimTrailingSlash("/path/*").andHandleRequest().build();

UrlHandlerFilter can be registered as any Servlet filter in your Spring Boot application.

Our next milestone will ship the WebFlux equivalent of UrlHandlerFilter, we are looking forward to hearing from the community about this highly requested feature.

New Web features

You can now test WebMvc.fn endpoints with MockMvcWebTestClient, just as you could already for your annotated controllers.

This milestone also introduces a new URL parser implementation, based on an algorithm provided in the Living URL standard. This significantly hardens our URL parsing infrastructure, in response of recent security reports.

Have you tested already our new MockMvc AssertJ integration with AssertableMockMvc? We recently renamed it to MvcTester and reviewed the structure of assertions.

6.2 features recap

Check out our What's New page for details about the new features available at this point.

Get the Spring newsletter

Stay connected with the Spring newsletter

Subscribe

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Tanzu Spring offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all