Skip to main content

Multiple URL Mappings

Learn Multiple URL Mappings (Controllers, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes Multiple URL mappings let one handler method answer several paths, written as an array: @GetMapping({"/home", "/index"}) . Use cases : aliases, old and new URLs during a migration, and a trailing or alternative path for the same page. Same method : every listed path runs the same code and returns the same view or body.

More lessons in Controllers