Optional Path Variables in Spring Web MVC

With a Spring Web MVC controller endpoint in Java you cannot have an optional @PathVariable, so you have to do things old school. In my code I wanted a default sorting mechanism, if the caller of my endpoint didn’t put in any sort parameters. The sort (orderBy) parameters are the fields, and the direction of […]