Skip to content

Roy Tutorials

Technical… Theoretical… Practical…

  • Home
  • FAQs
  • About Me
  • Home
  • @PathVariable

Tag: @PathVariable

Introduction In this tutorial I will show you how to define Spring optional path variable (PathVariable) in REST service. Here I will use Java 8’s java.util.Optional or using attribute required=false and at least Spring Boot 2.1.4 to support optional PathVariable.

Leave a Comment on Spring REST: Optional PathVariable
Posted in Java Spring REST

Spring REST: Optional PathVariable

This tutorial will show you how we use @PathVariable annotation with Regular Expressions in Spring Web MVC. Sometimes you need more precision in defining URI template variables. The @RequestMapping and @GetMapping annotations support the use of regular expressions in URI template variables. The syntax is {varName:regex} where the first part defines the variable name and…

Leave a Comment on Spring Web MVC @PathVariable with Regular Expressions
Posted in Spring MVC

Spring Web MVC @PathVariable with Regular Expressions

Path Variable This tutorial will show you how to use @PathVariable annotation in Spring MVC. The @PathVariable annotation is used on a method argument to bind it to the value of a URI template variable. You can also make this path variable optional in the URI. Path variable can appear in any path segment of…

Leave a Comment on Spring Boot Web MVC @PathVariable
Posted in Spring Boot Spring MVC

Spring Boot Web MVC @PathVariable

Categories

Copyright © 2014 - 2023 Roy Tutorials

Privacy | Terms & Conditions