Roufid

How to resolve Spring MVC path variable with slash

Spring

When you work with Spring MVC and you have a RequestMapping to something like  /elements/{id}, this binding will not work for elements having slash in their ids. This tutorial shows how to resolve resolve Spring MVC path variable with slash.

Let’s consider this example :

The id  CATEGORY1/CATEGORY1_1/ID will not work. Below the solution.

Solution

References