Spring MVC: Ignore Trailing Slashes in URL with Spring Framework 6

Опубликовано: 28 Октябрь 2024
на канале: Alex Gutjahr
418
3

In Spring Framework 6, trailing slashes "/" in URLs are no longer matched to the same endpoints without the slashes. Before that change, you could visit /ping or /ping/, and it would get matched to the same controller endpoint.

This no longer works, and eventually, you have to update your API clients or perform automatic redirects in your load balancers or controllers.

But for the time being, you can override this behavior in your configuration. Just be aware that this approach is deprecated and will eventually be removed.

🙌 Get in Touch
Join my newsletter and say hi here https://axgr.dev/newsletter/?utm_camp...

🎙 Gear & Links
Mechanical Keyboard: https://x.axgr.dev/keyboard
Studio Camera: https://x.axgr.dev/studio-camera
Studio Lens: https://x.axgr.dev/studio-lens
Studio Mic: https://x.axgr.dev/studio-mic
Vlog Camera: https://x.axgr.dev/vlog-camera
Vlog Lens: https://x.axgr.dev/vlog-lens

All my affiliate links https://axgr.dev/deals/?utm_campaign=...

I may earn a small commission for purchases made through the links above at no additional cost to you.

🍿 Subscribe
Want to see more tech tutorials? Subscribe now!