URL Matching with PathPattern in Spring MVC

Engineering | Rossen Stoyanchev | June 30, 2020 | ...

The recent Spring Framework 5.3 M1 release announcement mentions "Spring MVC comes with PathPattern parsing for efficient URL matching". This post expands on that with more context and detail.

Overview

In Spring applications AntPathMatcher is used to identify classpath, file system, remote, and other resources in Spring configuration. It has also been used in Spring MVC to match URL paths. Over time the use of patterns in web applications grew in number and syntax with AntPathMatcher evolving to meet those needs but some pain points remain without a solution:

  1. In web applications, patterns need to be matched many times per request and therefore any gains in performance and efficiency matter. However String pattern matching limits what can be achieved.

  2. Choosing the most specific pattern among several that match a request has proven challenging over the years with no simple ways to make it more predictable without impacting other cases.

  3. Matching a String path to a String pattern makes it difficult to avoid URI encoding issues. For example should the incoming path be decoded first and then matched? That allows for patterns themselves to be declared without encoded characters, but what if the request path contains %2F or %3B which are / and ; respectively? Once decoded those alter the structure of the path making it harder to match reliably. We could leave the request path encoded via UrlPathHelper#urlDecode

This Week in Spring - June 23, 2020

Engineering | Josh Long | June 23, 2020 | ...

Hi, Spring fans! What a week it's been! Tomorrow I'll be presenting a webinar on the easy integration between Spring Boot and Tanzu Wavefront. Wavefront is an all-in-one, integrated distributed tracing metrics analytics observability platform. Join us tomorrow to learn about observability, about Wavefront, and their integration in the Spring ecosystem with Spring Cloud Sleuth and Micrometer, among other things.

We've so many great things to look at this week so let's get to it!

What's new in Spring Boot 2.3

Engineering | Phil Webb | June 18, 2020 | ...

Speaker: Phil Webb (@phillip_webb)

Timecodes

Use the timecodes below if you want to jump to a specific part of the presentation:

  • 00:27 - Intro
  • 01:59 - Creating the Demo
  • 04:01 - Building Docker Images with the Spring Boot Plugin
  • 09:21 - Building Docker Images with a Dockerfile
  • 16:40 - Customizing Layers
  • 21:38 - Graceful Shutdown
  • 25:19 - Kubernetes Probes
  • 30:55 - Configuration Properties End-to-End Traceability
  • 33:00 - Wrap-up and Upgrade Gotchas

The following links are referenced in the presentation:

Getting Started With RSocket: Spring Security

Engineering | Ben Wilcock | June 17, 2020 | ...

Reading time: about 6 minutes Coding time: about 20 minutes

If you've been following my series on RSocket, you've already learned how to build client-server applications with Spring Boot. In today's exercise, you're going to learn how to add security to your RSocket applications.

The task of securing RSocket applications is greatly simplified when you use Spring Security. Spring Security is a must-have module for any production application. It allows you to easily plugin many different authentication providers and restricts each user's access to your application based on their identity and…

Spring Tips: Spring and GraalVM (pt. 2)

Engineering | Josh Long | June 16, 2020 | ...

speaker: Josh Long (@starbuxman)

Hi Spring fans! Welcome to a very special, interregnum episode of Spring Tips where we revisit Spring and GraalVM native images. I wanted to get this video out in light of the recent Spring Graal 0.7.1 release which drastically simplifies things even compared to the last time we looked at Spring and Graal waaay back in April 2020.

TL;DR: GraalVm is a JIT replacement that you can use with a stock-standard JVM, and that's worth looking into in its own right. GraalVM also offers a separate feature supporting native image compilation. This native-image builder takes bytecode and turns it into an architecture-specific binary that sheds the JVM and embeds something called SubstrateVM. Native images are fast to startup and they take way

This Week in Spring - June 16th, 2020

Engineering | Josh Long | June 16, 2020 | ...

Hi, Spring fans! Welcome to another jam-packed weekly roundup of This Week in Spring.

I've got a few upcoming speaking engagements you might be interested in. I'll be speaking (virtually) at the San Francisco JUG on June 24th at 6:30 PM. Join me!

Can't make it to the (virtual) SF JUG appearance? On June 30th, VMware Tanzu (where the Spring team lives) will be hosting one of my workshops, also on Reactive Spring. I'm going to cover tons of stuff: R2DBC, Reactor, Spring WebFlux, Spring WebFn, reactive Spring Data for SQL and NoSQL, RSocket, reactive security, reactive service orchestration, and composition patterns, and more. This is going to be at an ideal time for EU timezones, so please register now

Spring Cloud Data Flow 2.6.0-M1 Released

Spring Cloud Data Flow team is pleased to announce the first milestone release of 2.6.0.

This 2.6.0-M1 adds some bug fixes and the following features:

  • Composed Task Runner as SCDF native module Composed Task Runner is now an integral part of SCDF itself and gets registered implicitly while the users who have the custom composed task runner can still override the native one. This enables us to integrate the composed tasks management within the context of Spring Cloud Data Flow. This change also allowed us to provide some additional user experiences when managing composed tasks. .

  • Improvements in task applications management This milestone added some improvements at the backend such as the ability to uniquely identify the task elements inside the composed task, adding task manifest as part of the last ran task definition, ability to cleanup task related resources as part of task definition cleanup along with the SCDF dashboard changes.

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